You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
m3u8-downloader-TypeScript/scripts/dev.ts

33 lines
731 B
TypeScript

1 year ago
#!/usr/bin/env zx
import { os, echo, path, fs, $ } from "zx";
12 months ago
const platform = os.platform();
1 year ago
echo("开始构建 development ...");
echo("当前所在的目录是:", process.cwd());
12 months ago
const root = path.resolve(__dirname, "..");
const main = path.resolve(root, "packages/main");
const app = path.resolve(main, "app");
const bin = path.resolve(app, "bin");
let filename = path.resolve(bin, `${platform}/server`)
if (platform == "win32") {
filename += ".exe";
}
if (!fs.existsSync(filename)) {
await $`npm run build:server`;
}
1 year ago
12 months ago
if (!fs.existsSync(path.resolve(app, 'mobile'))) {
await $`npm run build:mobile`;
}
1 year ago
12 months ago
if (!fs.existsSync(path.resolve(app, 'plugin'))) {
await $`npm run build:plugin`;
}
1 year ago
await $`npm run types`;