Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build script when it doesn't run on a *curses terminal and dropped hardcoded prefix for package name #47

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/modules/Html/ManifestBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function getManifest(env: IEnv, args, permissions: Array<string>, deep_li
name: 'manifest',
keys: {
'xmlns:android': "http://schemas.android.com/apk/res/android",
'package':`com.androidjs.${package_name}`,
'package': package_name,
platformBuildVersionCode: env_manifist.platformBuildVersionCode,
platformBuildVersionName: env_manifist.platformBuildVersionName
}
Expand Down
14 changes: 7 additions & 7 deletions src/modules/Html/ProgressBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export class LoadingBar{
let _left = this.currentIndex - 1;
_left = _left < 0 ? 0 : _left;
let _right = this.bar_length - _left - 1;
process.stdout.write(`${this.message}${this.chunksDownloaded} :` + chalk.green(` ${this.empty.repeat(_left)}${this.fill}${this.empty.repeat(_right)}`));
process.stdout?.write(`${this.message}${this.chunksDownloaded} :` + chalk.green(` ${this.empty.repeat(_left)}${this.fill}${this.empty.repeat(_right)}`));
}
clear(){
//@ts-ignore
process.stdout.clearLine();
process.stdout?.clearLine();
//@ts-ignore
process.stdout.cursorTo(0);
process.stdout?.cursorTo(0);
}

start(speed?:number) {
Expand Down Expand Up @@ -83,7 +83,7 @@ export class ProgressBar {
constructor(total?:number) {
this.total = total || null;
this.current = 0;
this.bar_length = process.stdout.columns - 30;
this.bar_length = process.stdout.columns ? process.stdout.columns - 30 : 0;
// this.bar_length = 50;
}
next(progress) {
Expand All @@ -96,13 +96,13 @@ export class ProgressBar {

this.clearLine();
const _str = ` ${_p}% : ${chalk.green(this.bar_fill.repeat(_left-1)+_in_progress_code)}${ this.barr_empty.repeat(_right)}`;
process.stdout.write(_str);
process.stdout?.write(_str);
// console.log(_left, _right)
}
clearLine() {
//@ts-ignore
process.stdout.clearLine();
process.stdout?.clearLine();
//@ts-ignore
process.stdout.cursorTo(0);
process.stdout?.cursorTo(0);
}
}