forked from aris-creator/jancok
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepareCoreRepoClone.js
40 lines (35 loc) · 1017 Bytes
/
prepareCoreRepoClone.js
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
/**
* Setup core dependencies as they're not published yet
*/
const execa = require("execa");
const path = require("path");
const fs = require("fs-extra");
const tempDir = path.resolve(__dirname, "../temp");
const repoDir = `${tempDir}/next`;
const nuxtModuleDir = `${repoDir}/packages/core/nuxt-module`;
const corePackagesDir = path.resolve(__dirname, "../vsf-core-packages");
const nuxtModuleDestinationDir = `${corePackagesDir}/nuxt-module`;
async function run() {
/**
* Clone newest Next repo
*/
if (fs.existsSync(repoDir)) {
fs.removeSync(repoDir);
}
await execa("git", ["clone", "https://github.com/DivanteLtd/next", repoDir], {
stdio: "inherit"
});
if (!fs.existsSync(corePackagesDir)) {
fs.mkdirSync(corePackagesDir);
}
/**
* Prepare nuxt-module package
*/
if (fs.existsSync(nuxtModuleDestinationDir)) {
fs.removeSync(nuxtModuleDestinationDir);
}
await execa("cp", ["-r", nuxtModuleDir, nuxtModuleDestinationDir], {
stdio: "inherit"
});
}
run();