🚀 Hello World
This commit is contained in:
commit
0172c07623
1 changed files with 11896 additions and 0 deletions
33
scripts/create-dev-version.js
Executable file
33
scripts/create-dev-version.js
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import fs from "fs";
|
||||
|
||||
try {
|
||||
// Read current package.json
|
||||
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
||||
|
||||
// Get current version and strip any existing prerelease
|
||||
const baseVersion = packageJson.version.split("-")[0];
|
||||
|
||||
// Generate timestamp (YYYYMMDDHHMMSS)
|
||||
const now = new Date();
|
||||
const timestamp =
|
||||
now.getFullYear().toString() +
|
||||
(now.getMonth() + 1).toString().padStart(2, "0") +
|
||||
now.getDate().toString().padStart(2, "0") +
|
||||
now.getHours().toString().padStart(2, "0") +
|
||||
now.getMinutes().toString().padStart(2, "0") +
|
||||
now.getSeconds().toString().padStart(2, "0");
|
||||
|
||||
// Create dev version
|
||||
const devVersion = `${baseVersion}-dev.${timestamp}`;
|
||||
|
||||
console.log(`Publishing ${devVersion}...`);
|
||||
|
||||
// Update package.json version
|
||||
packageJson.version = devVersion;
|
||||
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
|
||||
} catch (error) {
|
||||
console.error("Failed to publish:", error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
Loading…
Reference in a new issue