Remove code that aided upgrade to v3
This commit is contained in:
parent
d90a81240f
commit
db4b292a38
@ -36,8 +36,6 @@ try {
|
|||||||
// fs.statSync will throw if config.js does not exist (e.g. first run)
|
// fs.statSync will throw if config.js does not exist (e.g. first run)
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.checkOldHome();
|
|
||||||
|
|
||||||
// Merge config key-values passed as CLI options into the main config
|
// Merge config key-values passed as CLI options into the main config
|
||||||
Helper.mergeConfig(Helper.config, program.config);
|
Helper.mergeConfig(Helper.config, program.config);
|
||||||
|
|
||||||
|
@ -23,31 +23,6 @@ class Utils {
|
|||||||
].forEach((e) => log.raw(e));
|
].forEach((e) => log.raw(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove in a couple of releases
|
|
||||||
static checkOldHome() {
|
|
||||||
const currentHome = Helper.getHomePath();
|
|
||||||
const oldHome = currentHome.replace(/\.thelounge$/, ".lounge");
|
|
||||||
|
|
||||||
if (currentHome === oldHome || !fs.existsSync(oldHome)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(); // eslint-disable-line no-console
|
|
||||||
log.warn(`Folder ${colors.bold.red(oldHome)} still exists.`);
|
|
||||||
log.warn(
|
|
||||||
`In v3, we renamed the default configuration folder to ${colors.bold.green(
|
|
||||||
".thelounge"
|
|
||||||
)} for consistency.`
|
|
||||||
);
|
|
||||||
log.warn(
|
|
||||||
`You might want to rename the folder from ${colors.bold.red(
|
|
||||||
".lounge"
|
|
||||||
)} to ${colors.bold.green(".thelounge")} to keep existing configuration.`
|
|
||||||
);
|
|
||||||
log.warn("Make sure to look at the release notes to see other breaking changes.");
|
|
||||||
console.log(); // eslint-disable-line no-console
|
|
||||||
}
|
|
||||||
|
|
||||||
static defaultHome() {
|
static defaultHome() {
|
||||||
if (home) {
|
if (home) {
|
||||||
return home;
|
return home;
|
||||||
|
@ -162,35 +162,6 @@ function setHome(newPath) {
|
|||||||
// Load theme color from the web manifest
|
// Load theme color from the web manifest
|
||||||
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
||||||
this.config.themeColor = manifest.theme_color;
|
this.config.themeColor = manifest.theme_color;
|
||||||
|
|
||||||
// TODO: Remove in future release
|
|
||||||
if (["example", "crypto", "zenburn"].includes(this.config.theme)) {
|
|
||||||
if (this.config.theme === "example") {
|
|
||||||
log.warn(
|
|
||||||
`The default theme ${colors.red("example")} was renamed to ${colors.green(
|
|
||||||
"default"
|
|
||||||
)} as of The Lounge v3.`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
log.warn(
|
|
||||||
`The theme ${colors.red(
|
|
||||||
this.config.theme
|
|
||||||
)} was moved to a separate theme as of The Lounge v3.`
|
|
||||||
);
|
|
||||||
log.warn(
|
|
||||||
`Install it with ${colors.bold(
|
|
||||||
"thelounge install thelounge-theme-" + this.config.theme
|
|
||||||
)}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
log.warn(
|
|
||||||
`Falling back to theme ${colors.green("default")} will be removed in a future release.`
|
|
||||||
);
|
|
||||||
log.warn("Please update your configuration file accordingly.");
|
|
||||||
|
|
||||||
this.config.theme = "default";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHomePath() {
|
function getHomePath() {
|
||||||
|
@ -12,12 +12,11 @@ describe("client-side constants", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should be made of pairs of strings", function() {
|
it("should be made of pairs of strings", function() {
|
||||||
constants.colorCodeMap.forEach((tuple) => {
|
constants.colorCodeMap.forEach(([code, name]) => {
|
||||||
// TODO: In Node v6+, use `[code, name]`
|
expect(code)
|
||||||
expect(tuple[0])
|
|
||||||
.to.be.a("string")
|
.to.be.a("string")
|
||||||
.that.match(/[0-9]{2}/);
|
.that.match(/[0-9]{2}/);
|
||||||
expect(tuple[1]).to.be.a("string");
|
expect(name).to.be.a("string");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user