-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inject next version into bundled "auto"
- Loading branch information
1 parent
b10d509
commit 16019d9
Showing
3 changed files
with
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
|
||
const { execSync } = require("child_process"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const dotenv = require("dotenv"); | ||
|
||
dotenv.config({ path: path.join(__dirname, "../../../.env") }); | ||
|
||
const nextVersion = execSync( | ||
`${path.join(__dirname, "../dist/bin/auto.js")} shipit -dq`, | ||
{ | ||
encoding: "utf-8", | ||
} | ||
).trim(); | ||
const parseArgsPath = path.join(__dirname, "../dist/parse-args.js"); | ||
const parseArgsContent = fs.readFileSync(parseArgsPath, { encoding: "utf-8" }); | ||
|
||
fs.writeFileSync( | ||
parseArgsPath, | ||
parseArgsContent.replace(/process\.env\.AUTO_CLI_VERSION/, `"${nextVersion}"`) | ||
); |
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