@glash/cli 0.2.46 → 0.2.48

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.
Files changed (2) hide show
  1. package/commands/pull.mjs +12 -2
  2. package/package.json +1 -1
package/commands/pull.mjs CHANGED
@@ -55,13 +55,15 @@ export async function pull(parsed) {
55
55
  async function chooseProject() {
56
56
  let projects;
57
57
  try {
58
- projects = await apiGet('/projects');
58
+ // Only projects this account owns: pulling takes the source and the
59
+ // runtime secrets, so anything else here would fail at the server anyway.
60
+ projects = await apiGet('/projects?ownedOnly=true');
59
61
  } catch (e) {
60
62
  fail(`Could not list your projects: ${e.message}`);
61
63
  return null;
62
64
  }
63
65
  if (!projects?.length) {
64
- fail('This account has no projects yet. Run `glash projects:new` first.');
66
+ fail('No projects you own. Pulling is limited to projects owned by your account.');
65
67
  return null;
66
68
  }
67
69
 
@@ -104,6 +106,14 @@ async function downloadAndExtract(token, slugOrId, outDir) {
104
106
  }
105
107
  if (!res.body) throw new Error('empty response from server');
106
108
 
109
+ // The server says which of the two sources it could serve.
110
+ if (res.headers.get('x-glash-pull-mode') === 'build-directory') {
111
+ stderr.write(color.dim(
112
+ ' ! this host runs an older glash agent, so the live image could not be unpacked\n' +
113
+ ' you are getting the build directory instead, which may hold only a Dockerfile and env files\n',
114
+ ));
115
+ }
116
+
107
117
  // Stream-pipe into `tar -xz -C outDir` via stdin
108
118
  const child = spawnSync('tar', ['-xz', '-C', outDir], { input: Buffer.from(await res.arrayBuffer()) });
109
119
  if (child.status !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glash/cli",
3
- "version": "0.2.46",
3
+ "version": "0.2.48",
4
4
  "description": "glashDB command-line interface - deploy projects, pull source + env, manage env vars.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://glashdb.com",