Skip to content

Commit

Permalink
Update box banner
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongquay committed Oct 17, 2020
1 parent 8759c6f commit 94ec4b0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
23 changes: 16 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const path = require('path')
const fs = require('fs')
const fetch = require('node-fetch')
const { yamlParse } = require('yaml-cfn');
process.env.DISABLE_BOX_BANNER = true
const simplify = require('simplify-sdk')
const utilities = require('simplify-sdk/utilities')
const provider = require('simplify-sdk/provider');
Expand All @@ -21,6 +22,12 @@ if (fs.existsSync(envFilePath)) {
require('dotenv').config({ path: envFilePath })
}

const showBoxBanner = function () {
console.log("╓───────────────────────────────────────────────────────────────╖")
console.log(`║ Simplify CLI - Version ${require('./package.json').version} ║`)
console.log("╙───────────────────────────────────────────────────────────────╜")
}

const getFunctionArn = function (functionName, locationFolder) {
const outputFile = path.resolve(locationFolder, `StackConfig.json`)
if (fs.existsSync(outputFile)) {
Expand Down Expand Up @@ -162,7 +169,7 @@ const deployStack = function (options) {
simplify.finishWithErrors(`${opName}-LoadYAMLResource:`, getErrorMessage(error))
}
})
})
}).catch(error => simplify.finishWithErrors(`${opName}-LoadYAMLResource:`, getErrorMessage(error)))
}

const destroyStack = function (options) {
Expand Down Expand Up @@ -543,6 +550,8 @@ const showAvailableStacks = (options, promptDescription) => {
utilities.printTableWithJSON(tableStackData)
}

showBoxBanner()

var argv = require('yargs').usage('simplify-cli init | deploy | destroy [options]')
.string('help').describe('help', 'Display Help for a specific command')
.string('name').describe('name', 'Specify a name for the created project')
Expand Down Expand Up @@ -632,12 +641,12 @@ if (cmdOPS === "DEPLOY") {
console.log(`\n *`, `Or install from URL: simplify-cli init [--template=]https://github.com/awslabs/...template.yml \n`)
} else {
createStackOnInit({
PROJECT_NAME: readlineSync.question(` - ${CPROMPT}What is your Project name?${CRESET} (starwars) `) || 'starwars',
DEPLOYMENT_BUCKET: readlineSync.question(` - ${CPROMPT}What is your Bucket name?${CRESET} (starwars-0920) `) || 'starwars-0920',
DEPLOYMENT_ACCOUNT: readlineSync.question(` - ${CPROMPT}What is your Account Id?${CRESET} (1234567890) `) || '1234567890',
DEPLOYMENT_PROFILE: readlineSync.question(` - ${CPROMPT}What is your Account profile?${CRESET} (simplify-eu) `) || 'simplify-eu',
DEPLOYMENT_REGION: readlineSync.question(` - ${CPROMPT}What is your Default region?${CRESET} (eu-central-1) `) || 'eu-central-1',
DEPLOYMENT_ENV: readlineSync.question(` - ${CPROMPT}What is your Environment name?${CRESET} (demo) `) || 'demo'
PROJECT_NAME: readlineSync.question(` - ${CPROMPT}What is your Project name?${CRESET} (${process.env.PROJECT_NAME || 'starwars'}) `) || `${process.env.PROJECT_NAME || 'starwars'}`,
DEPLOYMENT_BUCKET: readlineSync.question(` - ${CPROMPT}What is your Bucket name?${CRESET} (${process.env.DEPLOYMENT_BUCKET || 'starwars-0920'}) `) || `${process.env.DEPLOYMENT_BUCKET || 'starwars-0920'}`,
DEPLOYMENT_ACCOUNT: readlineSync.question(` - ${CPROMPT}What is your Account Id?${CRESET} (${process.env.DEPLOYMENT_ACCOUNT || '1234567890'}) `) || `${process.env.DEPLOYMENT_ACCOUNT || '1234567890'}`,
DEPLOYMENT_PROFILE: readlineSync.question(` - ${CPROMPT}What is your Account profile?${CRESET} (${process.env.DEPLOYMENT_PROFILE || 'simplify-eu'}) `) || `${process.env.DEPLOYMENT_PROFILE || 'simplify-eu'}`,
DEPLOYMENT_REGION: readlineSync.question(` - ${CPROMPT}What is your Default region?${CRESET} (${process.env.DEPLOYMENT_REGION || 'eu-central-1'}) `) || `${process.env.DEPLOYMENT_REGION || 'eu-central-1'}`,
DEPLOYMENT_ENV: readlineSync.question(` - ${CPROMPT}What is your Environment name?${CRESET} (${process.env.DEPLOYMENT_ENV || 'demo'}) `) || `${process.env.DEPLOYMENT_ENV || 'demo'}`
})
console.log(`\n *`, `Type '--help' with INIT to find more: simplify-cli init --help \n`)
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplify-cli",
"version": "0.1.20",
"version": "0.1.21",
"description": "Serverless CLI - Function as a Service",
"main": "cli.js",
"bin": {
Expand All @@ -25,7 +25,7 @@
"dependencies": {
"dotenv": "^8.2.0",
"readline-sync": "^1.4.10",
"simplify-sdk": "^0.1.48",
"simplify-sdk": "^0.1.49",
"yaml-cfn": "^0.2.3",
"yargs": "^15.4.1"
}
Expand Down
2 changes: 1 addition & 1 deletion template/stacks/Randomness/description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A Lambda randomness source to use in common case for other Lambdas
A Lambda randomness source to use in common case for other Lambdas

0 comments on commit 94ec4b0

Please sign in to comment.