diff --git a/src/puter-shell/coreutils/changelog.js b/src/puter-shell/coreutils/changelog.js index 312d17e..027ec4c 100644 --- a/src/puter-shell/coreutils/changelog.js +++ b/src/puter-shell/coreutils/changelog.js @@ -16,14 +16,12 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -// INCONST: called 'path' instead of 'path_' elsewhere -import path_ from "path-browserify"; import { SHELL_VERSIONS } from "../../meta/versions.js"; -function printVersion(ctx, version) { - ctx.externs.out.write(`\x1B[35;1m[v${version.v}]\x1B[0m\n`); +async function printVersion(ctx, version) { + await ctx.externs.out.write(`\x1B[35;1m[v${version.v}]\x1B[0m\n`); for ( const change of version.changes ) { - ctx.externs.out.write(`\x1B[32;1m+\x1B[0m ${change}\n`); + await ctx.externs.out.write(`\x1B[32;1m+\x1B[0m ${change}\n`); } } @@ -42,12 +40,12 @@ export default { }, execute: async ctx => { if (ctx.locals.values.latest) { - printVersion(ctx, SHELL_VERSIONS[0]); + await printVersion(ctx, SHELL_VERSIONS[0]); return; } for ( const version of SHELL_VERSIONS.toReversed() ) { - printVersion(ctx, version); + await printVersion(ctx, version); } } }; diff --git a/src/puter-shell/coreutils/clear.js b/src/puter-shell/coreutils/clear.js index 6b6ffb7..d38bf87 100644 --- a/src/puter-shell/coreutils/clear.js +++ b/src/puter-shell/coreutils/clear.js @@ -26,6 +26,6 @@ export default { allowPositionals: false }, execute: async ctx => { - ctx.externs.out.write('\x1B[H\x1B[2J'); + await ctx.externs.out.write('\x1B[H\x1B[2J'); } }; diff --git a/src/puter-shell/coreutils/cp.js b/src/puter-shell/coreutils/cp.js index d946483..032f7ec 100644 --- a/src/puter-shell/coreutils/cp.js +++ b/src/puter-shell/coreutils/cp.js @@ -40,7 +40,7 @@ export default { const { filesystem } = ctx.platform; if ( positionals.length < 1 ) { - err.write('cp: missing file operand\n'); + await err.write('cp: missing file operand\n'); throw new Exit(1); } @@ -48,7 +48,7 @@ export default { if ( positionals.length < 1 ) { const aft = positionals[0]; - err.write(`cp: missing destination file operand after '${aft}'\n`); + await err.write(`cp: missing destination file operand after '${aft}'\n`); throw new Exit(1); } @@ -59,7 +59,7 @@ export default { const srcStat = await filesystem.stat(srcAbsPath); if ( srcStat && srcStat.is_dir && ! values.recursive ) { - err.write(`cp: -R not specified; skipping directory '${srcRelPath}'\n`); + await err.write(`cp: -R not specified; skipping directory '${srcRelPath}'\n`); throw new Exit(1); } diff --git a/src/puter-shell/coreutils/ls.js b/src/puter-shell/coreutils/ls.js index a1fdf60..c30d8fb 100644 --- a/src/puter-shell/coreutils/ls.js +++ b/src/puter-shell/coreutils/ls.js @@ -110,7 +110,7 @@ export default { ? [pwd] : positionals ; const showHeadings = paths.length > 1 ? async ({ i, path }) => { - if ( i !== 0 ) ctx.externs.out.write('\n'); + if ( i !== 0 ) await ctx.externs.out.write('\n'); await ctx.externs.out.write(path + ':\n'); } : () => {}; diff --git a/src/puter-shell/coreutils/neofetch.js b/src/puter-shell/coreutils/neofetch.js index e6526ae..2906b84 100644 --- a/src/puter-shell/coreutils/neofetch.js +++ b/src/puter-shell/coreutils/neofetch.js @@ -89,7 +89,7 @@ export default { lines[15] += '\x1B[0m'; for ( const line of lines ) { - ctx.externs.out.write(line + '\n'); + await ctx.externs.out.write(line + '\n'); } } } diff --git a/src/puter-shell/coreutils/sample-data.js b/src/puter-shell/coreutils/sample-data.js index 9a31b1d..039b690 100644 --- a/src/puter-shell/coreutils/sample-data.js +++ b/src/puter-shell/coreutils/sample-data.js @@ -36,7 +36,7 @@ export default { } console.log('before writing'); - ctx.externs.out.write('Hello, World!\n'); + await ctx.externs.out.write('Hello, World!\n'); console.log('after writing'); } }