@junwu168/openshell 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,12 @@
4
4
  "Bash(git:*)",
5
5
  "Bash(bun test:*)",
6
6
  "Bash(gh repo:*)",
7
- "Bash(gh release:*)"
7
+ "Bash(gh release:*)",
8
+ "Bash(bun run:*)",
9
+ "Bash(npx tsc:*)",
10
+ "Bash(npm pack:*)",
11
+ "Bash(npm view:*)",
12
+ "Bash(tar -xzf junwu168-openshell-0.1.1.tgz)"
8
13
  ]
9
14
  }
10
15
  }
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  type WritableLike = {
2
3
  write(chunk: string): void;
3
4
  };
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { stderr, stdout } from "node:process";
2
3
  import { runInstallCli } from "../product/install.js";
3
4
  import { runUninstallCli } from "../product/uninstall.js";
@@ -327,7 +327,14 @@ const handleRemove = async (deps, idArg) => {
327
327
  return 0;
328
328
  };
329
329
  export const runServerRegistryCli = async (argv, deps) => {
330
- const activeDeps = deps ?? (await createDefaultDeps());
330
+ let activeDeps;
331
+ try {
332
+ activeDeps = deps ?? (await createDefaultDeps());
333
+ }
334
+ catch (err) {
335
+ console.error(`Failed to initialize: ${err instanceof Error ? err.message : err}`);
336
+ return 1;
337
+ }
331
338
  try {
332
339
  const [command, arg] = argv;
333
340
  switch (command) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junwu168/openshell",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "openshell": "./dist/cli/openshell.js"
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { stderr, stdout } from "node:process"
2
3
  import { runInstallCli } from "../product/install.js"
3
4
  import { runUninstallCli } from "../product/uninstall.js"
@@ -446,7 +446,13 @@ const handleRemove = async (deps: CliDeps, idArg?: string) => {
446
446
  }
447
447
 
448
448
  export const runServerRegistryCli = async (argv: string[], deps?: CliDeps) => {
449
- const activeDeps = deps ?? (await createDefaultDeps())
449
+ let activeDeps: CliDeps
450
+ try {
451
+ activeDeps = deps ?? (await createDefaultDeps())
452
+ } catch (err) {
453
+ console.error(`Failed to initialize: ${err instanceof Error ? err.message : err}`)
454
+ return 1
455
+ }
450
456
 
451
457
  try {
452
458
  const [command, arg] = argv