add refresh option to writeChanges
/ release (push) Successful in 1m7s

This commit is contained in:
2026-06-17 22:58:01 -07:00
parent 0d7796a9d6
commit b90f7f41e3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -61,7 +61,7 @@ try {
.action(async (options) => {
const { packDirectoryHandle, packFileBasename } = getPackInit()
const pack = await packwiz.refreshPack(packDirectoryHandle, packFileBasename, options["build"])
await pack.writeChanges(packDirectoryHandle, options["build"])
await pack.writeChanges(packDirectoryHandle, true, options["build"])
})
program.command("test-server [java]")
@@ -74,7 +74,7 @@ try {
if (!java) java = "stable"
const { packDirectoryHandle, packFileBasename } = getPackInit()
const pack = await packwiz.refreshPack(packDirectoryHandle, packFileBasename, true)
await pack.writeChanges(packDirectoryHandle, true)
await pack.writeChanges(packDirectoryHandle, true, true)
let version = pack.packMetaData.versions.minecraft
let loader = "VANILLA"
let loader_version = version
+2 -2
View File
@@ -97,7 +97,7 @@ export class PackwizPack {
}
}
async writeChanges(directoryHandle: FileSystemDirectoryHandle, build?: boolean) {
async writeChanges(directoryHandle: FileSystemDirectoryHandle, refresh?:boolean, build?:boolean) {
console.info("saving changes")
const packDirectory = new Directory(directoryHandle)
const packIndexDirectoryPath = this.packMetaData.index.file.split("/").slice(0, -1).join("/")
@@ -127,7 +127,7 @@ export class PackwizPack {
indexDirectory.writeFile(localPath, bytes)
})
if (changes.length === 0 && !build) {
if (!refresh && changes.length === 0) {
console.info("no changes to save")
return
}