-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupdate.js
More file actions
40 lines (34 loc) · 1.17 KB
/
Copy pathupdate.js
File metadata and controls
40 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env node
/**
* @file update.js
*
* Updates Blog-Doc to the latest version by pulling the newest code
* from the repository and refreshing dependencies.
*
* Run this from your project root whenever a new version is released:
*
* node update.js
* — or —
* npm run update
*
* Your content and data are never touched by this script.
* The following are gitignored and therefore completely safe:
*
* app/content/ ← your pages, posts and images
* app/data/ ← your settings, menus and active theme
* app/themes/ ← your installed themes (except the bundled default)
*/
import { execSync } from "child_process"
try {
console.log("\n Updating Blog-Doc...\n")
console.log(" › Pulling latest changes...")
execSync("git pull", { stdio: "inherit" })
console.log("\n › Installing dependencies...")
execSync("npm install", { stdio: "inherit" })
console.log("\n Blog-Doc updated successfully.")
console.log(" Your content and data are untouched.")
console.log("\n Start the app: npm start\n")
} catch (error) {
console.error("\n Update failed. See the error above for details.\n")
process.exit(1)
}