Skip to content

Commit 3c909ca

Browse files
authored
Fix install and update process (final time) (#3922)
1 parent 85a5bf2 commit 3c909ca

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

ct/gomft.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ function update_script() {
5151
tar -xzf "$temp_file"
5252
cp -rf "GoMFT-${RELEASE}"/* /opt/gomft/
5353
cd /opt/gomft
54-
rm -rf /opt/gomft/node_modules
55-
$STD npm ci
56-
$STD node build.js
57-
$STD go mod download
58-
$STD go get -u github.com/a-h/templ
54+
$STD npm install
55+
$STD npm run build
5956
$STD "$HOME"/go/bin/templ generate
6057
export CGO_ENABLED=1
6158
export GOOS=linux

install/gomft-install.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,13 @@ msg_ok "Installed Node.js"
4747
msg_info "Setup ${APPLICATION} (Patience)"
4848
temp_file=$(mktemp)
4949
RELEASE=$(curl -fsSL https://api.github.com/repos/StarFleetCPTN/GoMFT/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
50-
curl -fsSL "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -o $temp_file
51-
tar -xzf $temp_file
52-
mv GoMFT-${RELEASE}/ /opt/gomft
50+
curl -fsSL "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
51+
tar -xzf "$temp_file"
52+
mv GoMFT-"${RELEASE}"/ /opt/gomft
5353
cd /opt/gomft
54-
$STD npm ci
55-
$STD node build.js
56-
$STD go mod download
5754
$STD go install github.com/a-h/templ/cmd/templ@latest
58-
$STD go get -u github.com/a-h/templ
59-
$STD $HOME/go/bin/templ generate
60-
export CGO_ENABLED=1
61-
export GOOS=linux
62-
$STD go build -o gomft
55+
$STD "$HOME"/go/bin/templ generate
56+
$STD go build -o gomft main.go
6357
chmod +x /opt/gomft/gomft
6458
JWT_SECRET_KEY=$(openssl rand -base64 24 | tr -d '/+=')
6559

@@ -83,7 +77,7 @@ EMAIL_USERNAME=smtp_username
8377
EMAIL_PASSWORD=smtp_password
8478
EOF
8579

86-
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
80+
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
8781
msg_ok "Setup ${APPLICATION}"
8882

8983
msg_info "Creating Service"
@@ -109,7 +103,7 @@ motd_ssh
109103
customize
110104

111105
msg_info "Cleaning up"
112-
rm -f $temp_file
106+
rm -f "$temp_file"
113107
$STD apt-get -y autoremove
114108
$STD apt-get -y autoclean
115109
msg_ok "Cleaned"

0 commit comments

Comments
 (0)