@glash/cli 0.2.3 → 0.2.4
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.
- package/README.md +1 -0
- package/bin/glash.mjs +5 -1
- package/commands/update.mjs +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ glash deploy
|
|
|
33
33
|
| `glash env:rm KEY` | Remove an env var |
|
|
34
34
|
| `glash env:pull [--out .env.local]` | Pull env vars to a local file |
|
|
35
35
|
| `glash env:push [<file>]` | Bulk upload from a `.env` file |
|
|
36
|
+
| `glash update` | Update `@glash/cli` to the latest version |
|
|
36
37
|
|
|
37
38
|
Pass `--project <slug>` to any command to operate on a project other than
|
|
38
39
|
the one linked in the current directory.
|
package/bin/glash.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { argv, exit } from 'node:process';
|
|
|
3
3
|
import { parseArgs } from '../lib/args.mjs';
|
|
4
4
|
import { info, fail, color } from '../lib/ui.mjs';
|
|
5
5
|
|
|
6
|
-
const VERSION = '0.2.
|
|
6
|
+
const VERSION = '0.2.4';
|
|
7
7
|
|
|
8
8
|
const sub = argv[2];
|
|
9
9
|
const rest = argv.slice(3);
|
|
@@ -42,6 +42,7 @@ const commands = {
|
|
|
42
42
|
|
|
43
43
|
pull: () => import('../commands/pull.mjs').then((m) => m.pull(parsed)),
|
|
44
44
|
open: () => import('../commands/open.mjs').then((m) => m.open(parsed)),
|
|
45
|
+
update: () => import('../commands/update.mjs').then((m) => m.update(parsed)),
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
function usage() {
|
|
@@ -82,6 +83,9 @@ ${color.bold('ENV VARS')}
|
|
|
82
83
|
${color.bold('PULL')}
|
|
83
84
|
pull [<slug>] [--out dir] [--no-env] Pull source + .env from a glashDB project
|
|
84
85
|
|
|
86
|
+
${color.bold('SYSTEM')}
|
|
87
|
+
update Update @glash/cli to the latest version
|
|
88
|
+
|
|
85
89
|
${color.bold('FLAGS')}
|
|
86
90
|
--project <slug|id> Override the linked project for this command
|
|
87
91
|
--environment <name> Env-var environment (default: production)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { ok, fail, info, color } from '../lib/ui.mjs';
|
|
3
|
+
|
|
4
|
+
export async function update() {
|
|
5
|
+
info(color.dim('→ updating @glash/cli to latest...'));
|
|
6
|
+
const child = spawnSync('npm', ['install', '-g', '@glash/cli@latest'], { stdio: 'inherit' });
|
|
7
|
+
if (child.status !== 0) {
|
|
8
|
+
return fail(`Update failed with exit code ${child.status ?? 'unknown'}. Please run \`npm install -g @glash/cli@latest\` manually.`);
|
|
9
|
+
}
|
|
10
|
+
ok('Successfully updated @glash/cli to the latest version.');
|
|
11
|
+
}
|
package/package.json
CHANGED