Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
🎨 Tidy up some of the variable referencing when echo-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieconnolly committed Jan 3, 2017
1 parent a86cfeb commit 1c454de
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libexec/handles-get
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ "$PROJECT_NAME" =~ ^[A-Za-z0-9][A-Za-z0-9-]*\/[A-Za-z0-9_.][A-Za-z0-9_.-]*
REPO_NAME="${PROJECT_NAME#*/}"
REPO_OWNER="${PROJECT_NAME%%/*}"
elif [[ "$PROJECT_NAME" =~ ^[A-Za-z0-9_.][A-Za-z0-9_.-]*$ ]]; then
REPO_NAME=$PROJECT_NAME
REPO_NAME="$PROJECT_NAME"
REPO_OWNER="$(git config github.user)"
elif [ -n "$PROJECT_NAME" ]; then
echo "!!! Error: invalid project: ${PROJECT_NAME}" >&2
Expand Down
2 changes: 1 addition & 1 deletion libexec/handles-setup
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -f "nginx.conf.erb" ] && [ "$(uname -s)" = "Darwin" ]; then
export NGINX_LOG_DIR="${LOG_DIR}/nginx"

echo "==> Generating nginx server configuration file…"
handles-setup-nginx-conf $PROJECT_NAME
handles-setup-nginx-conf "$PROJECT_NAME"
fi

echo "==> Your project is now ready to go!"
2 changes: 1 addition & 1 deletion libexec/handles-setup-dotenv
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elif [ ! -f "$INPUT_FILE" ]; then
exit 1
fi

cp $INPUT_FILE .env
cp "$INPUT_FILE" .env

sed -e "s/^SECRET_KEY=$/SECRET_KEY=$(echo $(openssl rand -base64 48) | sed -e 's/[\/&]/\\&/g')/" -i "" .env
for var in $(env | sed -ne "s/\([^=]*\)=.*/\1/p" | uniq); do
Expand Down
4 changes: 2 additions & 2 deletions libexec/handles-setup-nginx-conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ elif ! command -v nginx &>/dev/null; then
exit 1
fi

if ! erb $INPUT_FILE > $OUTPUT_FILE; then
if ! erb "$INPUT_FILE" > "$OUTPUT_FILE"; then
echo "!!! Error: failed to generate nginx configuration file" >&2
exit 1
fi
Expand Down Expand Up @@ -53,7 +53,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi

SERVER_FILE="${PREFIX}/etc/nginx/servers/${PROJECT_NAME}.conf"
if ! ln -sf $OUTPUT_FILE $SERVER_FILE &>/dev/null; then
if ! ln -sf "$OUTPUT_FILE" "$SERVER_FILE" &>/dev/null; then
echo "!!! Error: failed to symlink ${OUTPUT_FILE} to ${SERVER_FILE}" >&2
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions libexec/handles-setup-postgres-db
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ elif ! command -v postgres &>/dev/null; then
exit 1
fi

if ! dropdb --if-exists $DB_NAME &>/dev/null; then
if ! dropdb --if-exists "$DB_NAME" &>/dev/null; then
echo "!!! Error: failed to drop database" >&2
exit 1
fi

if ! createdb $DB_NAME &>/dev/null; then
if ! createdb "$DB_NAME" &>/dev/null; then
echo "!!! Error: failed to create database" >&2
exit 1
fi

0 comments on commit 1c454de

Please sign in to comment.