diff --git a/src/main/pkg_mng/installs_steps_methods/git_clone.js b/src/main/pkg_mng/installs_steps_methods/git_clone.js index 994ea54..5c4184f 100644 --- a/src/main/pkg_mng/installs_steps_methods/git_clone.js +++ b/src/main/pkg_mng/installs_steps_methods/git_clone.js @@ -10,13 +10,8 @@ import Vars from "../../vars" const gitCMD = fs.existsSync(Vars.git_path) ? `${Vars.git_path}` : "git" export default async (manifest, step) => { - const tmp_path = path.resolve(os.tmpdir(), `rsb_${manifest.id}_clone_${new Date().getTime()}`) const final_path = path.resolve(manifest.install_path, step.path) - if (fs.existsSync(tmp_path)) { - fs.rmdirSync(tmp_path, { recursive: true }) - } - if (!fs.existsSync(final_path)) { fs.mkdirSync(final_path, { recursive: true }) } @@ -28,9 +23,9 @@ export default async (manifest, step) => { console.log(`[${manifest.id}] steps.git_clone() | Cloning ${step.url}...`) - const command = `${gitCMD} clone --recurse-submodules --remote-submodules ${step.url} ${tmp_path}` + const command = `${gitCMD} clone --recurse-submodules --remote-submodules ${step.url} ${final_path}` - fs.mkdirSync(final_path, { recursive: true }) + //fs.mkdirSync(final_path, { recursive: true }) await new Promise((resolve, reject) => { ChildProcess.exec( @@ -50,12 +45,5 @@ export default async (manifest, step) => { ) }) - // move tmp_path to final_path - await fs.promises.rename(tmp_path, final_path) - - if (fs.existsSync(tmp_path)) { - fs.rmdirSync(tmp_path, { recursive: true }) - } - return manifest } \ No newline at end of file diff --git a/src/main/pkg_mng/installs_steps_methods/index.js b/src/main/pkg_mng/installs_steps_methods/index.js index ffc6334..6757e56 100644 --- a/src/main/pkg_mng/installs_steps_methods/index.js +++ b/src/main/pkg_mng/installs_steps_methods/index.js @@ -28,6 +28,12 @@ export default async function processGenericSteps(pkg, steps) { const stepsEntries = Object.entries(steps) + stepsEntries = stepsEntries.sort((a, b) => StepsOrders.indexOf(a[0]) - StepsOrders.indexOf(b[0])) + + if (stepsEntries.length === 0) { + return pkg + } + for await (const [stepKey, stepValue] of stepsEntries) { switch (stepKey) { case "drive_downloads": {