-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add update manifest.json version script
- Loading branch information
1 parent
037aa99
commit 98d81b4
Showing
3 changed files
with
28 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { readFileSync, writeFileSync } from "fs"; | ||
import { resolve } from "path"; | ||
|
||
try { | ||
const packageJsonContent = JSON.parse(readFileSync(resolve("package.json"), "utf8")); | ||
|
||
const manifestPath = resolve("public", "manifest.json"); | ||
const manifestContent = JSON.parse(readFileSync(manifestPath, "utf8")); | ||
|
||
manifestContent.version = packageJsonContent.version; | ||
|
||
writeFileSync(manifestPath, JSON.stringify(manifestContent, null, 4)); | ||
|
||
console.log("Success! Version in manifest.json updated."); | ||
} catch (error) { | ||
console.error("Error! Failed to update manifest.json:", error); | ||
} |