2021-03-14 02:42:46 -05:00
|
|
|
import path from 'path';
|
|
|
|
import fs from 'fs';
|
2019-12-15 11:06:28 -05:00
|
|
|
|
2020-12-21 04:22:06 -05:00
|
|
|
export function createProject(projectName: string) {
|
|
|
|
// @ts-ignore
|
|
|
|
const tempRootFolder = global.__namespace.getItem('dir-suite-root');
|
|
|
|
const verdaccioInstall = path.join(tempRootFolder, projectName);
|
|
|
|
fs.mkdirSync(verdaccioInstall);
|
|
|
|
|
|
|
|
return verdaccioInstall;
|
|
|
|
}
|
2019-12-15 11:06:28 -05:00
|
|
|
export function copyConfigFile(rootFolder, configTemplate): string {
|
2021-03-14 02:42:46 -05:00
|
|
|
const configPath = path.join(rootFolder, 'verdaccio.yaml');
|
|
|
|
fs.copyFileSync(path.join(__dirname, configTemplate), configPath);
|
2019-12-15 11:06:28 -05:00
|
|
|
|
2021-03-14 02:42:46 -05:00
|
|
|
return configPath;
|
2019-12-15 11:06:28 -05:00
|
|
|
}
|