mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
fix(rewrite): Fix setup.mjs
on Unix-like systems
This commit is contained in:
parent
555cecb58f
commit
1e2b321bd8
@ -7,26 +7,24 @@ console.log("Setting up project");
|
||||
let currentlySettingUp = "";
|
||||
|
||||
const url = new URL(import.meta.url);
|
||||
let projectDir = path.resolve(
|
||||
url.pathname
|
||||
.split("/")
|
||||
.filter((v) => v && v.length > 0)
|
||||
.join(path.sep)
|
||||
);
|
||||
let projectDir = url.pathname
|
||||
.split("/")
|
||||
.filter((v) => v && v.length > 0)
|
||||
.join(path.sep)
|
||||
// This is a cheap but probably check to see if we're *not* on Windows.
|
||||
if (path.sep !== "\\") {
|
||||
// You could inline `path.sep` as "\" but why not go that extra mile
|
||||
// We're already using it so
|
||||
projectDir = path.sep + projectDir;
|
||||
}
|
||||
projectDir = path.dirname(projectDir);
|
||||
projectDir = path.dirname(path.resolve(projectDir));
|
||||
|
||||
const legacyDir = path.resolve(projectDir, "..");
|
||||
|
||||
function message(str) {
|
||||
let prefix = "";
|
||||
if (!!currentlySettingUp && currentlySettingUp.trim().length >= 0) {
|
||||
prefix = `[${currentlySettingUp}]`;
|
||||
prefix = `[${currentlySettingUp}] `;
|
||||
}
|
||||
console.log(" " + prefix + str);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user