Skip to content

Commit

Permalink
fix: config parse error
Browse files Browse the repository at this point in the history
Signed-off-by: Ar Rakin <[email protected]>
  • Loading branch information
virtual-designer committed Oct 28, 2024
1 parent 4d0fc98 commit 5b9a394
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35879,16 +35879,15 @@ const GitClient_1 = __nccwpck_require__(9367);
const VersionManager_1 = __nccwpck_require__(1526);
function run() {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
var _a, _b, _c, _d;
const env_1 = { stack: [], error: void 0, hasError: false };
try {
const allowedCommitTypes = core
.getInput("allowed-commit-types")
.split(",")
.filter(Boolean);
const versionJsonFiles = ((_a = core.getInput("version-json-file")) === null || _a === void 0 ? void 0 : _a.split(",")) || [
"package.json",
];
const versionJsonFiles = ((_b = (_a = core
.getInput("version-json-file")) === null || _a === void 0 ? void 0 : _a.split(",")) === null || _b === void 0 ? void 0 : _b.filter((s) => s !== "")) || ["package.json"];
const versionManagerModulePath = core.getInput("version-manager-module");
const jsonTabWidth = parseInt(core.getInput("json-tab-width") || "4");
const createTag = core.getInput("create-tag") === "true";
Expand All @@ -35915,6 +35914,7 @@ function run() {
if (versionJsonFiles.length === 0) {
throw new Error("No version file specified.");
}
core.info(`Version files: ${versionJsonFiles.join(", ")}`);
core.info(`Metadata file: ${metadataFile}`);
let metadataFileJSON;
const gitClient = __addDisposableResource(env_1, new GitClient_1.default(gitPath), true);
Expand Down Expand Up @@ -35956,7 +35956,7 @@ function run() {
const versionManagerModule = versionManagerModulePath
? yield Promise.resolve(`${versionManagerModulePath}`).then(s => require(s))
: null;
const getLastVersion = (_b = versionManagerModule === null || versionManagerModule === void 0 ? void 0 : versionManagerModule.resolver) !== null && _b !== void 0 ? _b : (() => __awaiter(this, void 0, void 0, function* () {
const getLastVersion = (_c = versionManagerModule === null || versionManagerModule === void 0 ? void 0 : versionManagerModule.resolver) !== null && _c !== void 0 ? _c : (() => __awaiter(this, void 0, void 0, function* () {
let version = null;
for (const versionJsonFile of versionJsonFiles) {
const packageJson = JSON.parse(yield (0, promises_1.readFile)(versionJsonFile, "utf-8"));
Expand All @@ -35972,7 +35972,7 @@ function run() {
}
return version;
}));
const updateVersion = (_c = versionManagerModule === null || versionManagerModule === void 0 ? void 0 : versionManagerModule.updater) !== null && _c !== void 0 ? _c : ((_versionManager, version) => __awaiter(this, void 0, void 0, function* () {
const updateVersion = (_d = versionManagerModule === null || versionManagerModule === void 0 ? void 0 : versionManagerModule.updater) !== null && _d !== void 0 ? _d : ((_versionManager, version) => __awaiter(this, void 0, void 0, function* () {
for (const versionJsonFile of versionJsonFiles) {
const packageJson = JSON.parse(yield (0, promises_1.readFile)(versionJsonFile, "utf-8"));
packageJson.version = version;
Expand Down
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ async function run() {
.getInput("allowed-commit-types")
.split(",")
.filter(Boolean);
const versionJsonFiles = core.getInput("version-json-file")?.split(",") || [
"package.json",
];
const versionJsonFiles = core
.getInput("version-json-file")
?.split(",")
?.filter((s) => s !== "") || ["package.json"];
const versionManagerModulePath = core.getInput("version-manager-module");
const jsonTabWidth = parseInt(core.getInput("json-tab-width") || "4");
const createTag = core.getInput("create-tag") === "true";
Expand Down Expand Up @@ -55,6 +56,7 @@ async function run() {
throw new Error("No version file specified.");
}

core.info(`Version files: ${versionJsonFiles.join(", ")}`);
core.info(`Metadata file: ${metadataFile}`);

let metadataFileJSON: {
Expand Down

0 comments on commit 5b9a394

Please sign in to comment.