mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-09 20:57:44 +00:00
chore: helper script for local dev (#492)
This commit is contained in:
@@ -9,18 +9,23 @@ const fileNameLatest = `openapi-cli.latest.tar.gz`;
|
||||
execSync(`tar -zcvf ${fileName} dist`);
|
||||
execSync(`tar -zcvf ${fileNameLatest} dist`);
|
||||
|
||||
const argv = yargs
|
||||
.option('aws-profile', {
|
||||
alias: 'p',
|
||||
type: 'string',
|
||||
})
|
||||
.argv;
|
||||
const argv = yargs.option('aws-profile', {
|
||||
alias: 'p',
|
||||
type: 'string',
|
||||
}).argv;
|
||||
|
||||
let profile = !!argv.awsProfile ? `--profile ${argv.awsProfile}` : '';
|
||||
|
||||
try {
|
||||
if (process.env.ENV === 'local') {
|
||||
execSync(`mkdir -p /tmp/redocly/openapi-cli/latest/`);
|
||||
execSync(`mkdir -p /tmp/redocly/openapi-cli/${version}/`);
|
||||
execSync(`cp -R dist /tmp/redocly/openapi-cli/latest/`);
|
||||
execSync(`cp -R dist /tmp/redocly/openapi-cli/${version}/`);
|
||||
} else {
|
||||
try {
|
||||
execSync(`aws s3 cp ${fileName} s3://${process.env.AWS_S3_PATH} ${profile}`);
|
||||
execSync(`aws s3 cp ${fileNameLatest} s3://${process.env.AWS_S3_PATH} ${profile}`);
|
||||
} catch (e) {
|
||||
} catch (e) {
|
||||
process.stderr.write(e.output);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user