-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import path = require("path"); | ||
import { Logger, assertSetup, loadConfig, pathExists } from "../common"; | ||
import * as fs from "fs/promises"; | ||
|
||
export const runPostPublish = async () => { | ||
await assertSetup(); | ||
|
||
const config = await loadConfig(); | ||
|
||
const prodPath = path.resolve(config.local.ttpg_path, config.project.slug); | ||
|
||
if (await pathExists(prodPath)) { | ||
const curManifest = JSON.parse(await fs.readFile(path.resolve(prodPath, "Manifest.json"), "utf8")); | ||
if ("ModID" in curManifest) { | ||
config.project.modId = Number(curManifest.ModID); | ||
await fs.writeFile(path.resolve("./ttpgcfg.project.json"), JSON.stringify(config.project), "utf-8"); | ||
Logger.success(`Captured MOD.io Mod Id: ${curManifest.ModID}`); | ||
} else { | ||
Logger.warning("There was no mod Id in the package, have you published it yet?"); | ||
} | ||
} else { | ||
Logger.warning("There is no production build in your ttpg folder - aborting"); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ export type Config = { | |
dev: string; | ||
prd: string; | ||
}; | ||
modId?: number; | ||
}; | ||
local: { | ||
ttpg_path: string; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters