Comparing version 0.4.3 to 0.4.4
@@ -14,2 +14,4 @@ "use strict"; | ||
const child_process = require("child_process"); | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const files = require("./files"); | ||
@@ -98,2 +100,7 @@ const downloader_1 = require("./downloader"); | ||
exports.runGitAsync = runGitAsync; | ||
function monoRepoConfigs(prj) { | ||
return fs.readdirSync(prj.directory) | ||
.map(fn => path.join(prj.directory, fn, "pxt.json")) | ||
.filter(fs.existsSync); | ||
} | ||
function bumpAsync(prj) { | ||
@@ -103,2 +110,3 @@ var _a, _b; | ||
yield needsGitCleanAsync(); | ||
yield runGitAsync("pull"); | ||
const cfg = prj.mainPkg.config; | ||
@@ -109,2 +117,12 @@ const m = /^(\d+\.\d+)\.(\d+)(.*)/.exec(cfg.version); | ||
cfg.version = newV; | ||
const configs = monoRepoConfigs(prj); | ||
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, JSON.stringify(cfg0, null, 4)); | ||
} | ||
} | ||
} | ||
yield files.writeFilesAsync(prj.directory, { "pxt.json": JSON.stringify(cfg, null, 4) }, true); | ||
@@ -111,0 +129,0 @@ yield runGitAsync("commit", "-a", "-m", newV); |
{ | ||
"name": "makecode", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "MakeCode (PXT) - web-cached build tool", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
110900
1657
7