Skip to content

Commit

Permalink
Fixes #28 use unix as target platform and add -x to gradlew
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox authored and modmuss50 committed Apr 21, 2023
1 parent 7788060 commit 6bbc31f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/src/lib/Template.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@
await generator.generateTemplate({
config,
writer: {
write: async (path, content) => {
zip.file(path, content);
write: async (path, content, options) => {
zip.file(path, content, options);
},
},
});
FileSaver.saveAs(
await zip.generateAsync({ type: "blob" }),
await zip.generateAsync({ type: "blob", platform: "UNIX" }),
`${modid}-template-${config.minecraftVersion}.zip`
);
Expand Down
4 changes: 3 additions & 1 deletion scripts/src/lib/template/gradlewrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import gitignore from './templates/git/gitignore?raw';
import workflow from './templates/git/workflow.yml?raw'

export async function addGradleWrapper({ writer }: Options) {
await writer.write('gradlew', gradlew);
await writer.write('gradlew', gradlew, {
unixPermissions: "774"
});
await writer.write('gradlew.bat', gradlewBat);
await writer.write('gradle/wrapper/gradle-wrapper.properties', gradleWrapperProperties);
await writer.write('gradle/wrapper/gradle-wrapper.jar', decode64(gradleWrapperJar));
Expand Down
3 changes: 2 additions & 1 deletion scripts/src/lib/template/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { addGroovyGradle } from './gradlegroovy';
import { getApiVersionForMinecraft, getKotlinAdapterVersions, getLoaderVersions, getMinecraftYarnVersions } from '../Api';
import { addModJson } from './modjson';
import { addGitFiles } from './git';
import type { JSZipFileOptions } from 'jszip';

export interface Options {
/**
Expand Down Expand Up @@ -45,7 +46,7 @@ export interface TemplateOptions {
}

export interface TemplateWriter {
write(path: string, content: string | ArrayBufferLike): Promise<void>
write(path: string, content: string | ArrayBufferLike, options?: JSZipFileOptions): Promise<void>
}

export async function generateTemplate(options: Options) {
Expand Down

0 comments on commit 6bbc31f

Please sign in to comment.