Skip to content

Commit fb0f828

Browse files
committed
restore server/esmd/main.go
1 parent ad01c46 commit fb0f828

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

scripts/deploy-ci.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@ echo " User ${DEPLOY_SSH_USER}" >> ~/.ssh/config
1111
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
1212
echo " IdentitiesOnly yes" >> ~/.ssh/config
1313

14-
src=$(dirname $0)/esmd.go
15-
if [ ! -f \$src ]; then
16-
echo "package main" >> $src
17-
echo "import \"github.com/esm-dev/esm.sh/server\"" >> $src
18-
echo "func main() { server.Serve() }" >> $src
19-
fi
20-
2114
echo "--- building server..."
22-
go build -ldflags="-s -w -X 'github.com/esm-dev/esm.sh/server.VERSION=${SERVER_VERSION}'" -o esmd $src
15+
go build -ldflags="-s -w -X 'github.com/esm-dev/esm.sh/server.VERSION=${SERVER_VERSION}'" -o esmd $(dirname $0)/../server/esmd/main.go
2316
if [ "$?" != "0" ]; then
24-
rm -f $src
2517
exit 1
2618
fi
27-
rm -f $src
2819
du -h esmd
2920

3021
echo "--- uploading server build..."

scripts/deploy.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,13 @@ if [ "$v" != "" ]; then
4848
sshPort="$v"
4949
fi
5050

51-
src=$(dirname $0)/esmd.go
52-
if [ ! -f \$src ]; then
53-
echo "package main" >> $src
54-
echo "import \"github.com/esm-dev/esm.sh/server\"" >> $src
55-
echo "func main() { server.Serve() }" >> $src
56-
fi
57-
5851
echo "--- building(${goos}_$goarch)..."
5952
export GOOS=$goos
6053
export GOARCH=$goarch
61-
go build -ldflags="-s -w" -o esmd $src
54+
go build -ldflags="-s -w" -o esmd $(dirname $0)/../server/esmd/main.go
6255
if [ "$?" != "0" ]; then
63-
rm -f $src
6456
exit
6557
fi
66-
rm -f $src
6758
du -h esmd
6859

6960
echo "--- uploading..."

server/esmd/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package main
2+
3+
import (
4+
"github.com/esm-dev/esm.sh/server"
5+
)
6+
7+
func main() {
8+
server.Serve()
9+
}

0 commit comments

Comments
 (0)