Skip to content

Commit

Permalink
fix github worker again
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiAF committed Jul 8, 2024
1 parent d8af385 commit fdf18dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,5 @@ jobs:
git submodule update --init --recursive
- name: Create dish workspace & patch
run: node ./dish/index.js
- name: "Clone Bundler"
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
repository: KaiAF/Dish-Bundler
path: Dish-Bundler
ref: main
- name: Compile dish
run: node ./dish/compile.js
19 changes: 9 additions & 10 deletions dish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,7 @@ function parseLibraries(libraries) {
// If workspace does not exist, try to create it.
// If it fails, error out
warn(`Workspace for version '${DECOMPILE_VERSION.split('/')[1]}' wasn't found. Running init.js in 5 seconds...`);
setTimeout(() => {
try {
execSync(`node init.js --MC="${DECOMPILE_VERSION}" --OLD_MC="${args[1] || ''}" --IGNORE-CACHE="${args[2] ? 'true' : 'false'}"`, { stdio });
execSync(`node dish/index.js ${DECOMPILE_VERSION}${args[1] ? ' ' + args[1] : ''}`, { stdio });
} catch (e) {
error(e);
return process.exit(1);
}
}, 1000 * 5);
return;
await generateWorkspace();
}

if (!fs.existsSync(`dish/libraries/${DECOMPILE_VERSION.split('/')[1]}.json`)) {
Expand Down Expand Up @@ -96,6 +87,14 @@ function parseLibraries(libraries) {
process.exit(0);
})();

async function generateWorkspace() {
return new Promise((res, rej) => {
execSync(`node init.js --MC="${DECOMPILE_VERSION}" --OLD_MC="${args[1] || ''}" --IGNORE-CACHE="${args[2] ? 'true' : 'false'}"`, { stdio });
execSync(`node dish/index.js ${DECOMPILE_VERSION}${args[1] ? ' ' + args[1] : ''}`, { stdio });
res();
});
}

async function cacheServer(version = DECOMPILE_VERSION.split('/')[1]) {
const manifestReq = await fetch('https://launchermeta.mojang.com/mc/game/version_manifest_v2.json');
if (manifestReq.status !== 200) {
Expand Down

0 comments on commit fdf18dc

Please sign in to comment.