Skip to content

Commit

Permalink
Use /usr/bin/env for locating binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Mimickal committed Aug 22, 2020
1 parent e31bc19 commit 8227731
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions resources/post-receive
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This should go in the "hooks" folder of your bare deployment repo.
# NOTE: You need to update this manually!

Expand All @@ -9,15 +9,15 @@ NODE_ENV="prod"

# Download all the dependencies and stuff
mkdir -p $TEMP
git --work-tree=$TEMP --git-dir=$REPO checkout -f
/usr/bin/env git --work-tree=$TEMP --git-dir=$REPO checkout -f
cd $TEMP
npm install
NODE_ENV=$NODE_ENV npm run knex migrate:latest
/usr/bin/env npm install
NODE_ENV=$NODE_ENV /usr/bin/env npm run knex migrate:latest

# Now install the code
cd /
rm -rf $TARGET
mv $TEMP $TARGET

# Restart the app
systemctl restart reactionrolebot.service
/usr/bin/env systemctl restart reactionrolebot.service
4 changes: 2 additions & 2 deletions resources/reactionrolebot.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ After=network.target network-online.target
Type=simple
Restart=on-failure
RestartSec=10
User=donut
User=<user>
Environment="NODE_ENV=prod"
ExecStart=/usr/local/bin/node /srv/discord/ReactionRoleBot/main.js
ExecStart=/usr/bin/env nodejs /srv/discord/ReactionRoleBot/main.js

[Install]
WantedBy=multi-user.target

0 comments on commit 8227731

Please sign in to comment.