fix paths

cleanup_stuff
joneugster 1 year ago
parent 427ce43e95
commit f53316c591

@ -79,17 +79,17 @@ async function doImport (owner, repo, id) {
artifactId = artifact.id artifactId = artifact.id
const url = artifact.archive_download_url const url = artifact.archive_download_url
// Make sure the download folder exists // Make sure the download folder exists
if (!fs.existsSync("../games")){ if (!fs.existsSync(`${__dirname}/../games`)){
fs.mkdirSync("../games"); fs.mkdirSync(`${__dirname}/../games`);
} }
if (!fs.existsSync("../games/tmp")){ if (!fs.existsSync(`${__dirname}/../games/tmp`)){
fs.mkdirSync("../games/tmp"); fs.mkdirSync(`${__dirname}/../games/tmp`);
} }
progress[id].output += `Download from ${url}\n` progress[id].output += `Download from ${url}\n`
await download(id, url, `../games/tmp/${owner.toLowerCase()}_${repo.toLowerCase()}_${artifactId}.zip`) await download(id, url, `${__dirname}/../games/tmp/${owner.toLowerCase()}_${repo.toLowerCase()}_${artifactId}.zip`)
progress[id].output += `Download finished.\n` progress[id].output += `Download finished.\n`
await runProcess(id, "/bin/bash", [`${__dirname}/unpack.sh`, artifactId, owner.toLowerCase(), repo.toLowerCase()], ".") await runProcess(id, "/bin/bash", [`${__dirname}/unpack.sh`, artifactId, owner.toLowerCase(), repo.toLowerCase()], `${__dirname}/..`)
// let manifest = fs.readFileSync(`tmp/artifact_${artifactId}_inner/manifest.json`); // let manifest = fs.readFileSync(`tmp/artifact_${artifactId}_inner/manifest.json`);

@ -4,8 +4,6 @@ ARTIFACT_ID=$1
OWNER=$2 OWNER=$2
REPO=$3 REPO=$3
echo "Creating folders"
cd ..
# mkdir -p games # mkdir -p games
cd games cd games
pwd pwd

Loading…
Cancel
Save