File tree Expand file tree Collapse file tree 5 files changed +10
-27
lines changed Expand file tree Collapse file tree 5 files changed +10
-27
lines changed Original file line number Diff line number Diff line change @@ -45,27 +45,8 @@ Restart=always
45
45
WantedBy=multi-user.target
46
46
EOF
47
47
48
- cat << EOF >> /bin/node-teslausb/build/website/package.json
49
- {
50
- "name": "website",
51
- "version": "1.0.0",
52
- "description": "",
53
- "main": "index.js",
54
- "type": "module",
55
- "scripts": {
56
- "test": "echo \"Error: no test specified\" && exit 1"
57
- },
58
- "keywords": [],
59
- "author": "",
60
- "license": "ISC",
61
- "dependencies": {
62
- "cheerio": "^1.0.0-rc.12"
63
- }
64
- }
65
- EOF
66
-
67
48
cd /bin/node-teslausb/build/website
68
- npm i
49
+ npm i --production
69
50
70
51
# Enable the service
71
52
systemctl enable node-teslausb-www.service
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ mkdir /mnt/TeslaCam
34
34
cd /bin/node-teslausb/src/worker/configure && npm i && node .
35
35
36
36
# Install required modules for worker
37
- cd /bin/node-teslausb/src /worker && npm i
37
+ cd /bin/node-teslausb/build /worker && npm i --production
38
38
39
39
# Create log directory
40
40
mkdir /logs
@@ -48,7 +48,7 @@ DefaultDependencies=no
48
48
[Service]
49
49
Type=simple
50
50
ExecStartPre=/bin/sleep 10
51
- ExecStart=/usr/bin/node /bin/node-teslausb/src /worker/index.js
51
+ ExecStart=/usr/bin/node /bin/node-teslausb/build /worker/index.js
52
52
WorkingDirectory=/bin/node-teslausb
53
53
StandardOutput=append:/logs/worker.log
54
54
StandardError=inherit
Original file line number Diff line number Diff line change 6
6
cd /bin/node-teslausb
7
7
git fetch --all
8
8
git reset --hard origin/main
9
- cd /bin/node-teslausb/src /worker && npm i
9
+ cd /bin/node-teslausb/build /worker && npm i --production
10
10
11
11
cat << EOF > /lib/systemd/system/node-teslausb.service
12
12
[Unit]
@@ -16,7 +16,7 @@ DefaultDependencies=no
16
16
[Service]
17
17
Type=simple
18
18
ExecStartPre=/bin/sleep 10
19
- ExecStart=/usr/bin/node /bin/node-teslausb/src /worker/index.js
19
+ ExecStart=/usr/bin/node /bin/node-teslausb/build /worker/index.js
20
20
WorkingDirectory=/bin/node-teslausb
21
21
StandardOutput=append:/logs/worker.log
22
22
StandardError=inherit
Original file line number Diff line number Diff line change 4
4
"private" : true ,
5
5
"scripts" : {
6
6
"dev" : " vite dev" ,
7
- "build" : " vite build" ,
7
+ "build" : " vite build && npm run copy-package-json " ,
8
8
"preview" : " vite preview" ,
9
9
"check" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" ,
10
10
"check:watch" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" ,
11
11
"lint" : " prettier --check . && eslint ." ,
12
- "format" : " prettier --write ."
12
+ "format" : " prettier --write ." ,
13
+ "copy-package-json" : " cp package.json ../../build/website/package.json"
13
14
},
14
15
"devDependencies" : {
15
16
"@sveltejs/adapter-auto" : " ^3.0.0" ,
Original file line number Diff line number Diff line change 6
6
"type" : " module" ,
7
7
"scripts" : {
8
8
"test" : " echo \" Error: no test specified\" && exit 1" ,
9
- "build" : " tsup"
9
+ "build" : " tsup && npm run copy-package-json" ,
10
+ "copy-package-json" : " cp package.json ../../build/worker/package.json"
10
11
},
11
12
"keywords" : [],
12
13
"author" : " " ,
You can’t perform that action at this time.
0 commit comments