Initial boiler plate project
This commit is contained in:
26
node_modules/next/dist/esm/lib/helpers/get-registry.js
generated
vendored
Normal file
26
node_modules/next/dist/esm/lib/helpers/get-registry.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
import { execSync } from "child_process";
|
||||
import { getPkgManager } from "./get-pkg-manager";
|
||||
import { getNodeOptionsWithoutInspect } from "../../server/lib/utils";
|
||||
/**
|
||||
* Returns the package registry using the user's package manager.
|
||||
* The URL will have a trailing slash.
|
||||
* @default https://registry.npmjs.org/
|
||||
*/ export function getRegistry(baseDir = process.cwd()) {
|
||||
let registry = `https://registry.npmjs.org/`;
|
||||
try {
|
||||
const pkgManager = getPkgManager(baseDir);
|
||||
const output = execSync(`${pkgManager} config get registry`, {
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_OPTIONS: getNodeOptionsWithoutInspect()
|
||||
}
|
||||
}).toString().trim();
|
||||
if (output.startsWith("http")) {
|
||||
registry = output.endsWith("/") ? output : `${output}/`;
|
||||
}
|
||||
} finally{
|
||||
return registry;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-registry.js.map
|
||||
Reference in New Issue
Block a user