Skip to content

Commit 490b2c0

Browse files
authored
Merge pull request #6 from lordlabuckdas/npx-fix
fixes 'serverless command not found'
2 parents 11641c9 + 44d89e2 commit 490b2c0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ magenta='\033[0;35m'
1111
reset='\033[0m' # reset style
1212

1313
deploy_command="serverless deploy $@ --verbose"
14+
if command -v npx &> /dev/null; then
15+
deploy_command="npx $deploy_command"
16+
elif ! command -v serverless &> /dev/null; then
17+
printf "${red}Serverless is not installed.${reset}\n\n"
18+
printf "Please run ${blue_bold}npm install --save-dev${reset} first and try again.\n"
19+
exit 1
20+
fi
1421

1522
printf "[1/4] ${blue}Deploying the core stack...${reset}\n"
1623
(cd core && $deploy_command)
@@ -20,6 +27,7 @@ printf "[2/4] ${blue}Deploying collectors and analyzers...${reset}\n"
2027
num_collectors_being_deployed=0
2128
# Deploy the stacks which have an environment file:
2229
if [[ -f credentials/analyzers.env ]]; then
30+
printf "${blue}Deploying the analyzers...${reset}\n"
2331
(cd analyzers && $deploy_command)&
2432
else
2533
printf "[x] ${red}Unable to deploy the analyzers - environment file does not exist${reset}\n"

0 commit comments

Comments
 (0)