Initial commit: 11ty website with Fire/Frost branding
This commit is contained in:
18
node_modules/node-retrieve-globals/util/getWorkingDirectory.js
generated
vendored
Normal file
18
node_modules/node-retrieve-globals/util/getWorkingDirectory.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
function addTrailingSlash(path) {
|
||||
if(path.endsWith("/")) {
|
||||
return path;
|
||||
}
|
||||
return path + "/";
|
||||
}
|
||||
|
||||
|
||||
function getWorkingDirectory() {
|
||||
// Trailing slash required
|
||||
// `import` and `require` should both be relative to working directory (not this file)
|
||||
return addTrailingSlash(pathToFileURL(path.resolve(".")).toString());
|
||||
}
|
||||
|
||||
export { getWorkingDirectory };
|
||||
Reference in New Issue
Block a user