|
1 | 1 | import {getPlatformDetails} from "./utils.js"; |
2 | 2 | import {execa} from "execa"; |
3 | 3 | import chalk from "chalk"; |
| 4 | +import {resolve} from "path"; |
4 | 5 |
|
5 | 6 | const {platform} = getPlatformDetails(); |
6 | 7 |
|
@@ -44,14 +45,18 @@ console.log(`Platform: ${platform}, target: ${target}`); |
44 | 45 | console.log('\nEnsure to start phoenix server at http://localhost:8000 for development.'); |
45 | 46 | console.log('Follow https://github.com/phcode-dev/phoenix#running-phoenix for instructions.\n'); |
46 | 47 |
|
47 | | -console.log('Setting up src-node...'); |
48 | | -await execa("npm", ["run", "_make_src-node"], {stdio: "inherit"}); |
49 | | - |
50 | 48 | // Run platform-specific command |
51 | 49 | if (target === "tauri") { |
| 50 | + console.log('Setting up src-node...'); |
| 51 | + await execa("npm", ["run", "_make_src-node"], {stdio: "inherit"}); |
| 52 | + |
52 | 53 | console.log('Starting Tauri dev server...'); |
53 | 54 | await execa("npx", ["tauri", "dev"], {stdio: "inherit"}); |
54 | 55 | } else { |
| 56 | + const srcNodePath = resolve("../phoenix/src-node"); |
| 57 | + console.log(`Running "npm ci" in ${srcNodePath}`); |
| 58 | + await execa("npm", ["ci"], {cwd: srcNodePath, stdio: "inherit"}); |
| 59 | + |
55 | 60 | console.log('Starting Electron...'); |
56 | 61 | await execa("./src-electron/node_modules/.bin/electron", ["src-electron/main.js"], {stdio: "inherit"}); |
57 | 62 | } |
0 commit comments