Skip to content

Commit 679cc05

Browse files
committed
Amended use of chdir
1 parent 11604a7 commit 679cc05

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/commands/uninstall.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var chalk = require('chalk'),
1414

1515
module.exports = {
1616
apiuninstall:function(pluginName, cwd) {
17-
if (cwd) process.chdir(cwd);
17+
Constants.setCwd(cwd);
1818

1919
var project = new Project(Constants.DefaultProjectManifestPath, Constants.DefaultProjectFrameworkPath);
2020

@@ -31,7 +31,7 @@ module.exports = {
3131
pluginType = resolver.resolve(keywords);
3232

3333
return uninstallPackage(plugin, {
34-
directory: path.join('src', pluginType.belongsTo)
34+
directory: path.join(Constants.cwd, 'src', pluginType.belongsTo)
3535
});
3636
})
3737
.then(function () {
@@ -47,7 +47,7 @@ module.exports = {
4747
var removePath;
4848

4949
['components', 'extensions', 'menu', 'theme'].forEach(function(pluginType) {
50-
var pluginPath = path.join('src', pluginType, plugin.packageName);
50+
var pluginPath = path.join(Constants.cwd, 'src', pluginType, plugin.packageName);
5151

5252
if (fs.existsSync(pluginPath)) {
5353
removePath = pluginPath;
@@ -93,7 +93,7 @@ module.exports = {
9393

9494
renderer.log(chalk.cyan(plugin.packageName), 'found.', 'Uninstalling', pluginType.typename, '...');
9595
return uninstallPackage(plugin, {
96-
directory: path.join('src', pluginType.belongsTo)
96+
directory: path.join(Constants.cwd, 'src', pluginType.belongsTo)
9797
});
9898
})
9999
.then(function () {
@@ -109,7 +109,7 @@ module.exports = {
109109
var removePath;
110110

111111
['components', 'extensions', 'menu', 'theme'].forEach(function(pluginType) {
112-
var pluginPath = path.join('src', pluginType, plugin.packageName);
112+
var pluginPath = path.join(Constants.cwd, 'src', pluginType, plugin.packageName);
113113

114114
if (fs.existsSync(pluginPath)) {
115115
removePath = pluginPath;

0 commit comments

Comments
 (0)