runcloud 0.2.145 → 0.2.146

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.
@@ -5,6 +5,11 @@ export function assertDevOnly(env, command) {
5
5
  throw new Error(`\`newly ${command}\` is dev-only from the CLI. Prod ${command} requires the Newly web app (a browser session).`);
6
6
  }
7
7
  }
8
+ export function assertKnownEnv(env, command) {
9
+ if (env !== 'dev' && env !== 'prod') {
10
+ throw new Error(`\`newly ${command}\` --env must be dev or prod (got ${JSON.stringify(env)})`);
11
+ }
12
+ }
8
13
  export function parseDuration(s) {
9
14
  const m = /^(\d+)(s|m|h)$/.exec(s.trim());
10
15
  if (!m)
@@ -128,7 +133,7 @@ export function registerMisc(program) {
128
133
  .option('--project <id>', 'project id')
129
134
  .action(async (opts) => {
130
135
  try {
131
- assertDevOnly(opts.env, 'secrets list');
136
+ assertKnownEnv(opts.env, 'secrets list');
132
137
  const { client, projectId } = makeClient(opts.project);
133
138
  console.log(await listSecrets(client, projectId, opts.env, opts.service));
134
139
  }
@@ -146,7 +151,7 @@ export function registerMisc(program) {
146
151
  .option('--project <id>', 'project id')
147
152
  .action(async (key, value, opts) => {
148
153
  try {
149
- assertDevOnly(opts.env, 'secrets set');
154
+ assertKnownEnv(opts.env, 'secrets set');
150
155
  const { client, projectId } = makeClient(opts.project);
151
156
  await setSecret(client, projectId, opts.env, opts.service, key, value);
152
157
  console.log(`Secret ${key} set for ${opts.service} (${opts.env}). Redeploy to apply.`);
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.145';
1
+ export const CLI_VERSION = '0.2.146';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.145",
3
+ "version": "0.2.146",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
Binary file
Binary file