Commit bae6146
src/cli.ts
@@ -174,7 +174,6 @@ async function importPath(filepath: string, origin = filepath) {
}
if (argv.install) {
const deps = parseDeps(await fs.readFile(filepath))
- console.log('Installing dependencies...', deps)
await installDeps(deps, dirname(filepath))
}
const __filename = resolve(origin)
src/deps.ts
@@ -13,6 +13,7 @@
// limitations under the License.
import { $ } from './core.js'
+import { spinner } from './experimental.js'
export async function installDeps(
dependencies: Record<string, string>,
@@ -25,7 +26,9 @@ export async function installDeps(
if (packages.length === 0) {
return
}
- await $`npm install --no-save --no-audit --no-fund ${flags} ${packages}`
+ await spinner(`npm i ${packages.join(' ')}`, () =>
+ $`npm install --no-save --no-audit --no-fund ${flags} ${packages}`.nothrow()
+ )
}
const builtins = new Set([