Comparing version 0.29.0 to 0.30.0
@@ -17,3 +17,2 @@ "use strict"; | ||
const mkc = require("./mkc"); | ||
const files = require("./files"); | ||
const downloader_1 = require("./downloader"); | ||
@@ -116,4 +115,3 @@ const glob_1 = require("glob"); | ||
exports.monoRepoConfigs = monoRepoConfigs; | ||
function collectCurrentVersion(prj) { | ||
const configs = monoRepoConfigs(prj.directory, true); | ||
function collectCurrentVersion(configs) { | ||
let version = "0.0.0"; | ||
@@ -137,4 +135,4 @@ for (const config of configs) { | ||
} | ||
const cfg = prj.mainPkg.config; | ||
const currentVersion = collectCurrentVersion(prj); | ||
const configs = monoRepoConfigs(prj.directory, true); | ||
const currentVersion = collectCurrentVersion(configs); | ||
let newV = currentVersion; | ||
@@ -146,5 +144,5 @@ if (release) | ||
const newTag = "v" + newV; | ||
cfg.version = newV; | ||
mkc.log(`new version: ${newV}`); | ||
if (versionFile) { | ||
const cfg = prj.mainPkg.config; | ||
mkc.log(`writing version in ${versionFile}`); | ||
@@ -165,13 +163,8 @@ const versionSrc = ` | ||
} | ||
const configs = monoRepoConfigs(prj.directory, false); | ||
if (configs.length > 0) { | ||
if ((yield queryAsync(`Also update sub-packages (${configs.length}) in this repo?`, "y")) == "y") { | ||
for (const fn of configs) { | ||
const cfg0 = JSON.parse(fs.readFileSync(fn, "utf8")); | ||
cfg0.version = newV; | ||
fs.writeFileSync(fn, mkc.stringifyConfig(cfg0)); | ||
} | ||
} | ||
for (const fn of configs) { | ||
const cfg0 = JSON.parse(fs.readFileSync(fn, "utf8")); | ||
cfg0.version = newV; | ||
mkc.debug(`updating ${fn}`); | ||
fs.writeFileSync(fn, mkc.stringifyConfig(cfg0)); | ||
} | ||
yield files.writeFilesAsync(prj.directory, { "pxt.json": mkc.stringifyConfig(cfg) }, true); | ||
if (!stage) { | ||
@@ -178,0 +171,0 @@ yield runGitAsync("commit", "-a", "-m", newV); |
{ | ||
"name": "makecode", | ||
"version": "0.29.0", | ||
"version": "0.30.0", | ||
"description": "MakeCode (PXT) - web-cached build tool", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -151,3 +151,3 @@ # MKC - command line tool for MakeCode editors | ||
Interactive update of the version number of the current project | ||
and nested projects in a mono-repo. | ||
and all nested projects in a mono-repo. | ||
@@ -154,0 +154,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213204
3236