Skip to content

Commit

Permalink
made changes
Browse files Browse the repository at this point in the history
Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
  • Loading branch information
skoeva committed Jun 19, 2024
1 parent 8f0bb30 commit 8b7c61a
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions plugins/headlamp-plugin/bin/headlamp-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function create(name, link) {
.split('$${name}')
.join(name)
.split('$${headlamp-plugin-version}')
.join(headlampPluginPkg.version),
.join(headlampPluginPkg.version)
);
}

Expand All @@ -84,7 +84,7 @@ function create(name, link) {
});
} catch (e) {
console.error(
`Problem running npm install inside of "${dstFolder}" abs: "${resolve(dstFolder)}"`,
`Problem running npm install inside of "${dstFolder}" abs: "${resolve(dstFolder)}"`
);
return 3;
}
Expand Down Expand Up @@ -279,7 +279,7 @@ async function start() {
console.warn(
' @kinvolk/headlamp-plugin is out of date. Run the following command to upgrade \n' +
` See release notes here: ${url}` +
' npx @kinvolk/headlamp-plugin upgrade',
' npx @kinvolk/headlamp-plugin upgrade'
);
} else {
console.log(' @kinvolk/headlamp-plugin is up to date.');
Expand Down Expand Up @@ -375,7 +375,7 @@ function runScriptOnPackages(packageFolder, scriptName, cmdLine, env) {
'..',
'..',
'..',
nodeModulesBinCmd,
nodeModulesBinCmd
);

if (fs.existsSync(nodeModulesBinCmd)) {
Expand All @@ -387,8 +387,8 @@ function runScriptOnPackages(packageFolder, scriptName, cmdLine, env) {
} else {
console.warn(
`"${scriptCmd}" not found in "${resolve(nodeModulesBinCmd)}" or "${resolve(
upNodeModulesBinCmd,
)}" or "${resolve(npxBinCmd)}".`,
upNodeModulesBinCmd
)}" or "${resolve(npxBinCmd)}".`
);
}

Expand Down Expand Up @@ -434,7 +434,7 @@ function runScriptOnPackages(packageFolder, scriptName, cmdLine, env) {
};
});
const failedErrorFolders = errorFolders.filter(
errFolder => errFolder.error !== runOnPackageReturn.success,
errFolder => errFolder.error !== runOnPackageReturn.success
);

if (failedErrorFolders.length === 0) {
Expand All @@ -455,14 +455,14 @@ function runScriptOnPackages(packageFolder, scriptName, cmdLine, env) {
const folderErr = runOnFolderOfPackages(packageFolder);
if (folderErr.error === runOnPackageReturn.notThere) {
console.error(
`"${resolve(packageFolder)}" does not contain a package or packages. Not ${scriptName}-ing.`,
`"${resolve(packageFolder)}" does not contain a package or packages. Not ${scriptName}-ing.`
);
return 1; // failed
} else if (folderErr.error === runOnPackageReturn.issue) {
console.error(
`Some in "${resolve(packageFolder)}" failed. Failed folders: ${folderErr.failedFolders.join(
', ',
)}`,
', '
)}`
);
return 1; // failed
}
Expand Down Expand Up @@ -682,7 +682,7 @@ function upgrade(packageFolder, skipPackageUpdates, headlampPluginVersion) {
const templateFolder = path.resolve(__dirname, '..', 'template');
const packageJsonPath = path.join('.', 'package.json');
const templatePackageJson = JSON.parse(
fs.readFileSync(path.join(templateFolder, 'package.json'), 'utf8'),
fs.readFileSync(path.join(templateFolder, 'package.json'), 'utf8')
);
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
let configChanged = false;
Expand All @@ -703,8 +703,8 @@ function upgrade(packageFolder, skipPackageUpdates, headlampPluginVersion) {
configChanged = true;
console.log(
`Updated package.json field ${keyName}.${key}: ${JSON.stringify(
packageJson[keyName][key],
)}`,
packageJson[keyName][key]
)}`
);
}
});
Expand Down Expand Up @@ -860,7 +860,7 @@ function upgrade(packageFolder, skipPackageUpdates, headlampPluginVersion) {
for (const folder of packageFolders) {
if (failed) {
console.error(
`Skipping "${folder.name}", because "${failed}" did not upgrade successfully.`,
`Skipping "${folder.name}", because "${failed}" did not upgrade successfully.`
);
continue;
}
Expand Down Expand Up @@ -941,11 +941,11 @@ function storybook(packageFolder) {
stdio: 'inherit',
cwd: packageFolder,
encoding: 'utf8',
},
}
);
} catch (e) {
console.error(
`Problem running storybook dev inside of "${packageFolder}" abs: "${resolve(packageFolder)}"`,
`Problem running storybook dev inside of "${packageFolder}" abs: "${resolve(packageFolder)}"`
);
return 1;
}
Expand Down Expand Up @@ -991,7 +991,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = build(argv.package);
},
}
)
.command('start', 'Watch for changes and build plugin.', {}, async () => {
process.exitCode = await start();
Expand All @@ -1013,7 +1013,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = create(argv.name, argv.link);
},
}
)
.command(
'extract <pluginPackages> <outputPlugins>',
Expand All @@ -1036,7 +1036,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = extract(argv.pluginPackages, argv.outputPlugins);
},
}
)
.command(
'format [package]',
Expand All @@ -1056,7 +1056,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = format(argv.package, argv.check);
},
}
)
.command(
'lint [package]',
Expand All @@ -1077,7 +1077,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = lint(argv.package, argv.fix);
},
}
)
.command(
'tsc [package]',
Expand All @@ -1093,7 +1093,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = tsc(argv.package);
},
}
)
.command(
'storybook [package]',
Expand All @@ -1107,7 +1107,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = storybook(argv.package);
},
}
)
.command(
'storybook-build [package]',
Expand All @@ -1122,7 +1122,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = storybook_build(argv.package);
},
}
)
.command(
'upgrade [package]',
Expand All @@ -1148,7 +1148,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = upgrade(argv.package, argv.skipPackageUpdates, argv.headlampPluginVersion);
},
}
)
.command(
'test [package]',
Expand All @@ -1162,7 +1162,7 @@ yargs(process.argv.slice(2))
},
argv => {
process.exitCode = test(argv.package);
},
}
)
.demandCommand(1, '')
.strict()
Expand Down

0 comments on commit 8b7c61a

Please sign in to comment.