git-coco 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.mjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -1611,7 +1611,8 @@ function execPromise(command, options = {}) {
|
|
|
1611
1611
|
* @returns {Promise<boolean>} - A promise that resolves to true if the package is installed successfully, false otherwise.
|
|
1612
1612
|
*/
|
|
1613
1613
|
async function installNpmPackage({ name, flags = [], cwd = process.cwd(), }) {
|
|
1614
|
-
const
|
|
1614
|
+
const version = name.includes('@') ? '' : '@latest';
|
|
1615
|
+
const { stdout, stderr } = await execPromise(`npm i ${name}${version} ${flags.join(' ')} --yes`, { cwd });
|
|
1615
1616
|
if (stderr) {
|
|
1616
1617
|
console.error(`Execution error: ${stderr}`);
|
|
1617
1618
|
return false;
|
|
@@ -1673,7 +1674,7 @@ async function checkAndHandlePackageInstallation({ global = false, logger, }) {
|
|
|
1673
1674
|
return;
|
|
1674
1675
|
}
|
|
1675
1676
|
logger.startSpinner(`Installing '${packageName}' in project...`, { color: 'blue' });
|
|
1676
|
-
await installNpmPackage({ name: packageName, cwd: projectRoot });
|
|
1677
|
+
await installNpmPackage({ name: packageName, cwd: projectRoot, flags: ['--save-dev'] });
|
|
1677
1678
|
logger.stopSpinner(`Installed '${packageName}' in project`);
|
|
1678
1679
|
}
|
|
1679
1680
|
catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -1632,7 +1632,8 @@ function execPromise(command, options = {}) {
|
|
|
1632
1632
|
* @returns {Promise<boolean>} - A promise that resolves to true if the package is installed successfully, false otherwise.
|
|
1633
1633
|
*/
|
|
1634
1634
|
async function installNpmPackage({ name, flags = [], cwd = process.cwd(), }) {
|
|
1635
|
-
const
|
|
1635
|
+
const version = name.includes('@') ? '' : '@latest';
|
|
1636
|
+
const { stdout, stderr } = await execPromise(`npm i ${name}${version} ${flags.join(' ')} --yes`, { cwd });
|
|
1636
1637
|
if (stderr) {
|
|
1637
1638
|
console.error(`Execution error: ${stderr}`);
|
|
1638
1639
|
return false;
|
|
@@ -1694,7 +1695,7 @@ async function checkAndHandlePackageInstallation({ global = false, logger, }) {
|
|
|
1694
1695
|
return;
|
|
1695
1696
|
}
|
|
1696
1697
|
logger.startSpinner(`Installing '${packageName}' in project...`, { color: 'blue' });
|
|
1697
|
-
await installNpmPackage({ name: packageName, cwd: projectRoot });
|
|
1698
|
+
await installNpmPackage({ name: packageName, cwd: projectRoot, flags: ['--save-dev'] });
|
|
1698
1699
|
logger.stopSpinner(`Installed '${packageName}' in project`);
|
|
1699
1700
|
}
|
|
1700
1701
|
catch (error) {
|