mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-24 22:52:09 -05:00
feat(assets): pull specific branch for assets if specified
This commit is contained in:
parent
5e0c8e0444
commit
d8f2cac171
1 changed files with 3 additions and 1 deletions
|
@ -4,6 +4,7 @@ const { exec: cexec } = require("child_process");
|
|||
const { resolve } = require("path");
|
||||
|
||||
let target = process.env.REVOLT_SASS;
|
||||
let branch = process.env.REVOLT_SASS_BRANCH;
|
||||
let DEFAULT_DIRECTORY = "public/assets_default";
|
||||
let OUT_DIRECTORY = "public/assets";
|
||||
|
||||
|
@ -29,7 +30,8 @@ function exec(command) {
|
|||
} catch (err) {}
|
||||
|
||||
if (target) {
|
||||
await exec(`git clone ${target} ${OUT_DIRECTORY}`);
|
||||
let arg = branch ? `-b ${branch}` : "";
|
||||
await exec(`git clone ${arg}${target} ${OUT_DIRECTORY}`);
|
||||
await exec(`rm -rf ${resolve(OUT_DIRECTORY, ".git")}`);
|
||||
} else {
|
||||
await copy(DEFAULT_DIRECTORY, OUT_DIRECTORY);
|
||||
|
|
Loading…
Reference in a new issue