Comparing version 0.1.2-alpha.4 to 0.1.2-alpha.5
@@ -73,4 +73,3 @@ "use strict"; | ||
if (!accessToken || tokenResponse.error) { | ||
this.error(new Error(`Failed to acquire access token: ${tokenResponse.error || | ||
`no code returned, got ${JSON.stringify(tokenResponse, null, 2)}`}`)); | ||
this.error(new Error(`Failed to acquire access token: ${tokenResponse.error} - response: ${JSON.stringify(tokenResponse, null, 2)}`)); | ||
} | ||
@@ -77,0 +76,0 @@ await config_1.writeSiteConfig(config, site, { accessToken }); |
@@ -61,2 +61,9 @@ "use strict"; | ||
exports.doPublish = async (manifest, manifestPath, ignore, config, site, printJson) => { | ||
let gitsha = null; | ||
try { | ||
gitsha = await util_1.runCmdPromise(path_1.default.dirname(manifestPath), "git", "rev-parse", "HEAD"); | ||
} | ||
catch (e) { | ||
/* swallow this error, this is just a best effort. */ | ||
} | ||
const form = new form_data_1.default(); | ||
@@ -76,2 +83,6 @@ const { root, bundle, missing } = await exports.createBundle(manifest, manifestPath, ignore); | ||
})); | ||
if (gitsha) { | ||
form.append("gitsha", gitsha); | ||
console.log(gitsha); | ||
} | ||
const fetch = await cli_api_1.default(config, site); | ||
@@ -78,0 +89,0 @@ const response = await cli_api_1.successOnly(fetch(`app/${manifest.id}`, "post", form), printJson); |
import ncp from "ncp"; | ||
export declare const runCmd: (cwd: string, command: string, ...args: string[]) => Promise<unknown>; | ||
export declare const runCmd: (cwd: string, command: string, ...args: string[]) => Promise<void>; | ||
export declare const runCmdPromise: (cwd: string, command: string, ...args: string[]) => Promise<string>; | ||
export declare const readRecursive: (dir: string, skip: string) => Promise<string[]>; | ||
export declare const pathExists: (filePath: string) => Promise<boolean>; | ||
export declare const copy: (source: string, dest: string, options?: ncp.Options) => Promise<void>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.copy = exports.pathExists = exports.readRecursive = exports.runCmd = void 0; | ||
exports.copy = exports.pathExists = exports.readRecursive = exports.runCmdPromise = exports.runCmd = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -13,14 +13,27 @@ const chalk_1 = tslib_1.__importDefault(require("chalk")); | ||
exports.runCmd = (cwd, command, ...args) => { | ||
return exports.runCmdPromise(cwd, command, ...args) | ||
.then((stdout) => console.log(stdout)) | ||
.catch((error) => { | ||
print_1.println(chalk_1.default `{red Command failed: ${command} ${args.join(" ")}}`); | ||
print_1.println(chalk_1.default `{red CWD: ${cwd}}`); | ||
print_1.println(chalk_1.default `{red ${error.stack}}`); | ||
process.exit(1); | ||
}); | ||
}; | ||
exports.runCmdPromise = (cwd, command, ...args) => { | ||
return new Promise((resolve, reject) => { | ||
const cmd = child_process_1.spawn(command, [...args], { | ||
cwd, | ||
stdio: ["inherit", "inherit", "inherit"], | ||
stdio: ["inherit", "pipe", "inherit"], | ||
}); | ||
let stdout = ""; | ||
cmd.stdout.on("data", (d) => { | ||
stdout += d; | ||
}); | ||
cmd.on("error", (error) => { | ||
print_1.println(chalk_1.default `{red Command failed: ${command} ${args.join(" ")}}`); | ||
print_1.println(chalk_1.default `{red CWD: ${cwd}}`); | ||
print_1.println(chalk_1.default `{red ${error.stack}}`); | ||
process.exit(1); | ||
reject(error); | ||
}); | ||
cmd.on("close", resolve); | ||
cmd.on("close", () => { | ||
resolve(stdout); | ||
}); | ||
}); | ||
@@ -27,0 +40,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
{"version":"0.1.2-alpha.4","commands":{"apps":{"id":"apps","description":"Browse, inspect, and manipulate your Apps","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"id":{"name":"id","type":"option","char":"i","description":"show the details of an app ID"},"version":{"name":"version","type":"option","char":"v","description":"which version to show the details for. Only useful with --id"},"json":{"name":"json","type":"boolean","char":"j","description":"output responses in JSON","allowNo":false},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]},"bump":{"id":"bump","description":"Bump the application version","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"increment","description":"which number to bump - can be one of 'major', 'minor', or 'patch' - defaults to 'patch'"}]},"init":{"id":"init","description":"Initialize a new Live App Project","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"dry-run":{"name":"dry-run","type":"boolean","char":"d","description":"Print what this would do, but don't create any files.","hidden":true,"allowNo":false},"no-create":{"name":"no-create","type":"boolean","description":"only create a local app (don't create an app in the dev console or assign an ID)","allowNo":false},"dir":{"name":"dir","type":"option","char":"d","description":"specify directory to create app in (defaults to the name provided)"},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"json":{"name":"json","type":"boolean","char":"j","description":"output responses in JSON (must provide --name and --id)","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"set the name of the application"},"id":{"name":"id","type":"option","char":"i","description":"set the ID of the application"},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]},"login":{"id":"login","description":"Logs in to Quip and stores credentials in the .quiprc file","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"forces a re-login even if a user is currently logged in","allowNo":false},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"port":{"name":"port","type":"option","description":"Use a custom port for the OAuth redirect server (defaults to 9898)","hidden":true,"default":9898},"hostname":{"name":"hostname","type":"option","description":"Use a custom hostname for the OAuth redirect server (defaults to 127.0.0.1)","hidden":true,"default":"127.0.0.1"},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]},"migration":{"id":"migration","description":"Creates a new migration","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"folder":{"name":"folder","type":"option","char":"f","description":"The folder where your migrations are stored","default":"migrations"},"version":{"name":"version","type":"option","char":"v","description":"The version to generate this migration for. By default, it will use the current version_number in the manifest"},"dry-run":{"name":"dry-run","type":"boolean","char":"d","description":"Print what this would do, but don't create any files.","allowNo":false},"manifest":{"name":"manifest","type":"option","char":"m","description":"A manifest.json file to add the migration to. By default, we'll use the first one we find.","hidden":true}},"args":[{"name":"name","description":"A short description to generate the filename with"}]},"publish":{"id":"publish","description":"Uploads this bundle to the developer console, and sets it as the latest development version.","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"json":{"name":"json","type":"boolean","char":"j","description":"output responses in JSON","allowNo":false},"ignore":{"name":"ignore","type":"option","char":"i","description":"blob to ignore. Defaults to 'node_modules'","default":"node_modules"},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]}}} | ||
{"version":"0.1.2-alpha.5","commands":{"apps":{"id":"apps","description":"Browse, inspect, and manipulate your Apps","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"id":{"name":"id","type":"option","char":"i","description":"show the details of an app ID"},"version":{"name":"version","type":"option","char":"v","description":"which version to show the details for. Only useful with --id"},"json":{"name":"json","type":"boolean","char":"j","description":"output responses in JSON","allowNo":false},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]},"bump":{"id":"bump","description":"Bump the application version","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"increment","description":"which number to bump - can be one of 'major', 'minor', or 'patch' - defaults to 'patch'"}]},"init":{"id":"init","description":"Initialize a new Live App Project","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"dry-run":{"name":"dry-run","type":"boolean","char":"d","description":"Print what this would do, but don't create any files.","hidden":true,"allowNo":false},"no-create":{"name":"no-create","type":"boolean","description":"only create a local app (don't create an app in the dev console or assign an ID)","allowNo":false},"dir":{"name":"dir","type":"option","char":"d","description":"specify directory to create app in (defaults to the name provided)"},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"json":{"name":"json","type":"boolean","char":"j","description":"output responses in JSON (must provide --name and --id)","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"set the name of the application"},"id":{"name":"id","type":"option","char":"i","description":"set the ID of the application"},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]},"login":{"id":"login","description":"Logs in to Quip and stores credentials in the .quiprc file","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"forces a re-login even if a user is currently logged in","allowNo":false},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"port":{"name":"port","type":"option","description":"Use a custom port for the OAuth redirect server (defaults to 9898)","hidden":true,"default":9898},"hostname":{"name":"hostname","type":"option","description":"Use a custom hostname for the OAuth redirect server (defaults to 127.0.0.1)","hidden":true,"default":"127.0.0.1"},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]},"migration":{"id":"migration","description":"Creates a new migration","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"folder":{"name":"folder","type":"option","char":"f","description":"The folder where your migrations are stored","default":"migrations"},"version":{"name":"version","type":"option","char":"v","description":"The version to generate this migration for. By default, it will use the current version_number in the manifest"},"dry-run":{"name":"dry-run","type":"boolean","char":"d","description":"Print what this would do, but don't create any files.","allowNo":false},"manifest":{"name":"manifest","type":"option","char":"m","description":"A manifest.json file to add the migration to. By default, we'll use the first one we find.","hidden":true}},"args":[{"name":"name","description":"A short description to generate the filename with"}]},"publish":{"id":"publish","description":"Uploads this bundle to the developer console, and sets it as the latest development version.","pluginName":"quip-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"json":{"name":"json","type":"boolean","char":"j","description":"output responses in JSON","allowNo":false},"ignore":{"name":"ignore","type":"option","char":"i","description":"blob to ignore. Defaults to 'node_modules'","default":"node_modules"},"site":{"name":"site","type":"option","char":"s","description":"use a specific quip site rather than the standard quip.com login","default":"quip.com"},"config":{"name":"config","type":"option","description":"Use a custom config file (default ~/.quiprc)","hidden":true,"default":"/home/runner/.quiprc"}},"args":[]}}} |
{ | ||
"name": "quip-cli", | ||
"description": "A Command Line Interface for the Quip Live Apps platform", | ||
"version": "0.1.2-alpha.4", | ||
"version": "0.1.2-alpha.5", | ||
"author": "Quip", | ||
@@ -86,3 +86,3 @@ "bin": { | ||
"types": "lib/index.d.ts", | ||
"gitHead": "046afbd4abd346149dea4719649cc206ed869e69" | ||
"gitHead": "62cd8de22e58047f44b7bdc12e6a94ddc7478604" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114325
1961