Skip to content

Commit e402687

Browse files
Add prettier-plugin-sh (#762)
## Description: Add prettier-plugin-sh to format shell files. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --------- Co-authored-by: Scott Anderson <[email protected]>
1 parent 6517f80 commit e402687

File tree

13 files changed

+193
-127
lines changed

13 files changed

+193
-127
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ helm-charts
1212
.env
1313
.editorconfig
1414
.idea
15-
coverage*
15+
coverage*

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ end_of_line = lf
77
indent_size = 2
88
indent_style = space
99
insert_final_newline = true
10+
11+
[*.sh]
12+
indent_size = 4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ TODO.txt
66
resources/images/.DS_Store
77
resources/.DS_Store
88
.env*
9-
.DS_Store
9+
.DS_Store

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
export PATH="/usr/local/bin:$HOME/.npm-global/bin:$HOME/.nvm/versions/node/$(node -v)/bin:$PATH"
66

77
# Then run lint-staged if tests pass
8-
npx lint-staged
8+
npx lint-staged

.prettierrc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
{
2-
"plugins": ["prettier-plugin-organize-imports"]
2+
"overrides": [
3+
{
4+
"files": ".husky/**",
5+
"options": {
6+
"plugins": []
7+
}
8+
},
9+
{
10+
"files": "Dockerfile",
11+
"options": {
12+
"plugins": []
13+
}
14+
}
15+
],
16+
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-sh"]
317
}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ WORKDIR /usr/src/app
3333
COPY package*.json ./
3434

3535
# Install dependencies while bypassing Husky hooks
36-
ENV HUSKY=0
36+
ENV HUSKY=0
3737
ENV NPM_CONFIG_IGNORE_SCRIPTS=1
3838
RUN mkdir -p .git && npm install
3939

@@ -60,4 +60,4 @@ COPY startup.sh /usr/local/bin/
6060
RUN chmod +x /usr/local/bin/startup.sh
6161

6262
# Use the startup script as the entrypoint
63-
ENTRYPOINT ["/usr/local/bin/startup.sh"]
63+
ENTRYPOINT ["/usr/local/bin/startup.sh"]

deploy.sh

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
# 2. Copies the update script to Hetzner server
66
# 3. Executes the update script on the Hetzner server
77

8-
set -e # Exit immediately if a command exits with a non-zero status
8+
set -e # Exit immediately if a command exits with a non-zero status
99

1010
# Initialize variables
1111
ENABLE_BASIC_AUTH=false
1212

1313
# Parse command line arguments
1414
POSITIONAL_ARGS=()
1515
while [[ $# -gt 0 ]]; do
16-
case $1 in
17-
--enable_basic_auth)
18-
ENABLE_BASIC_AUTH=true
19-
shift
20-
;;
21-
*)
22-
POSITIONAL_ARGS+=("$1")
23-
shift
24-
;;
25-
esac
16+
case $1 in
17+
--enable_basic_auth)
18+
ENABLE_BASIC_AUTH=true
19+
shift
20+
;;
21+
*)
22+
POSITIONAL_ARGS+=("$1")
23+
shift
24+
;;
25+
esac
2626
done
2727

2828
# Restore positional parameters
@@ -58,7 +58,7 @@ print_header() {
5858

5959
ENV=$1
6060
HOST=$2
61-
SUBDOMAIN=$3 # Optional third argument for custom subdomain
61+
SUBDOMAIN=$3 # Optional third argument for custom subdomain
6262

6363
# Set subdomain - use the custom subdomain if provided, otherwise use REGION
6464
if [ -n "$SUBDOMAIN" ]; then
@@ -116,10 +116,10 @@ else
116116
fi
117117

118118
# Configuration
119-
UPDATE_SCRIPT="./update.sh" # Path to your update script
120-
REMOTE_USER="openfront"
121-
REMOTE_UPDATE_PATH="/home/$REMOTE_USER"
122-
REMOTE_UPDATE_SCRIPT="$REMOTE_UPDATE_PATH/update-openfront.sh" # Where to place the script on server
119+
UPDATE_SCRIPT="./update.sh" # Path to your update script
120+
REMOTE_USER="openfront"
121+
REMOTE_UPDATE_PATH="/home/$REMOTE_USER"
122+
REMOTE_UPDATE_SCRIPT="$REMOTE_UPDATE_PATH/update-openfront.sh" # Where to place the script on server
123123

124124
VERSION_TAG=$(date +"%Y%m%d-%H%M%S")
125125
DOCKER_IMAGE="${DOCKER_USERNAME}/${DOCKER_REPO}:${VERSION_TAG}"
@@ -139,15 +139,15 @@ echo "Using version tag: $VERSION_TAG"
139139
echo "Docker repository: $DOCKER_REPO"
140140

141141
# Get Git commit for build info
142-
GIT_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
142+
GIT_COMMIT=$(git rev-parse HEAD 2> /dev/null || echo "unknown")
143143
echo "Git commit: $GIT_COMMIT"
144144

145145
docker buildx build \
146-
--platform linux/amd64 \
147-
--build-arg GIT_COMMIT=$GIT_COMMIT \
148-
-t $DOCKER_IMAGE \
149-
--push \
150-
.
146+
--platform linux/amd64 \
147+
--build-arg GIT_COMMIT=$GIT_COMMIT \
148+
-t $DOCKER_IMAGE \
149+
--push \
150+
.
151151

152152
if [ $? -ne 0 ]; then
153153
echo "❌ Docker build failed. Stopping deployment."
@@ -206,4 +206,4 @@ if [ "$ENABLE_BASIC_AUTH" = true ]; then
206206
echo "🔒 Basic authentication enabled with user: $BASIC_AUTH_USER"
207207
fi
208208
echo "🌐 Check your server to verify the deployment."
209-
echo "======================================================="
209+
echo "======================================================="

example.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ MON_USERNAME=monitor_username
2929
MON_PASSWORD=monitor_password
3030

3131
# Version
32-
VERSION_TAG="latest"
32+
VERSION_TAG="latest"

package-lock.json

Lines changed: 50 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"postcss-loader": "^8.1.1",
6262
"prettier": "^3.5.3",
6363
"prettier-plugin-organize-imports": "^4.1.0",
64+
"prettier-plugin-sh": "^0.17.4",
6465
"raw-loader": "^4.0.2",
6566
"sinon": "^18.0.0",
6667
"sinon-chai": "^4.0.0",

0 commit comments

Comments
 (0)