Skip to content

Commit 135c740

Browse files
committed
#91 CLI v0.11 update command; ref npm/npm-www#638
1 parent d87fe93 commit 135c740

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

org.nodeclipse.ui/templates/.npmignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/.settings/
33
/.jshintrc
44
/.project
5+
mongodb-replicaset
6+
z_snippets
57
npm-debug.log
68
*.list
7-
z_snippets

org.nodeclipse.ui/templates/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ List of workspace projects
149149
Examples: `nci install from kepler jsdt`
150150
- 0.10.10 uninstall, materialize
151151
Examples: `nci uninstall mongodb.shell` , `nci new from luna to d:/progs/eclipse-diy-luna/`
152+
- 0.11.0 `update` command as p2-director needs uninstall then install (example `nodeclipse update markdown`)
152153

153154
## News
154155

org.nodeclipse.ui/templates/bin/nodeclipse.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ if (argv[2]=='help') argv[2]='--help'; // to make it visible to optimist (don't
1212

1313
if ( argv[2]=='install' || argv[2]=='i' //install
1414
|| argv[2]=='list' //list repository
15-
|| argv[2]=='materialize' || argv[2]=='new' || argv[2]=='uninstall'
15+
|| argv[2]=='materialize' || argv[2]=='new' || argv[2]=='uninstall' || argv[2]=='update'
1616
|| ( argv[2]=='help' || argv[2]=='--help' || argv[2]=='-h')
17-
&& (argv[3]=='aliases' || argv[3]=='install' || argv[3]=='list' || argv[3]=='materialize' || argv[3]=='uninstall') ) // help on nci,epm
17+
&& (argv[3]=='aliases' || argv[3]=='install' || argv[3]=='list'
18+
|| argv[3]=='materialize' || argv[2]=='new' || argv[2]=='uninstall' || argv[2]=='update') ) // help on nci,epm
1819
{
1920
var installerjs = path.join(path.dirname(fs.realpathSync(__filename)), '../nodeclipse-install.js');
2021
var c = require(installerjs);

org.nodeclipse.ui/templates/nodeclipse-install.js

+22-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ var plugins = [
105105
{alias: 'icons', name: 'org.eclipse_icons.editor.feature.feature.group'},
106106
{alias: 'jjs', name: 'org.nodeclipse.jjs.feature.feature.group'},
107107
{alias: 'jsdt', name: 'org.eclipse.wst.jsdt.feature.feature.group', repository: 'current'}, // requires kepler,etc update site
108-
{alias: 'less', name: 'net.vtst.ow.eclipse.less.feature.feature.group', repository: 'enide'}, // TODO
108+
{alias: 'less', name: 'net.vtst.ow.eclipse.less.feature.feature.group', repository: 'enide-repository'}, // TODO
109109
{alias: 'markdown', name: 'markdown.editor.feature.feature.group'},
110110
{alias: 'maven', name: 'org.nodeclipse.enide.maven.feature.feature.group'}, //org.nodeclipse.enide.maven.feature.feature.jar,
111111
{alias: 'mongodb', name: 'net.jumperz.app.MMonjaDB.feature.group'},
@@ -123,13 +123,14 @@ var plugins = [
123123
];
124124
var repositories = [
125125
{name: 'dev', url: 'jar:file:/D:/Workspaces/Nodeclipse-DEV/nodeclipse-1/org.nodeclipse.site/target/org.nodeclipse.site-0.10.0-SNAPSHOT.zip!/'},//hack to help author
126-
{name: 'nodeclipse', url: 'http://www.nodeclipse.org/updates/'},
127-
{name: 'enide', url: 'https://raw.github.com/Enide/eclipse-p2-composite-repository/master/'},
126+
{name: 'nodeclipse-updates', url: 'http://www.nodeclipse.org/updates/'},
127+
{name: 'enide-repository', url: 'https://raw.github.com/Enide/eclipse-p2-composite-repository/master/'},
128128
{name: 'indigo', url: 'http://download.eclipse.org/releases/indigo'},
129129
{name: 'juno', url: 'http://download.eclipse.org/releases/juno'},
130-
{name: '4.3', url: 'http://download.eclipse.org/eclipse/updates/4.3'}, // likely is part of kepler
130+
{name: '4.3', url: 'http://download.eclipse.org/eclipse/updates/4.3'}, // is part of kepler
131131
{name: 'kepler', url: 'http://download.eclipse.org/releases/kepler'}, //current
132132
{name: 'current', url: 'http://download.eclipse.org/releases/kepler'}, //current
133+
{name: '4.4', url: 'http://download.eclipse.org/eclipse/updates/4.4'},
133134
{name: 'luna', url: 'http://download.eclipse.org/releases/luna'},
134135
];
135136

@@ -219,7 +220,8 @@ if (argv[2]=='i'){
219220
if (argv.length === 2
220221
|| argv[2]=='help' || argv[2]=='--help' || argv[2]=='-h'
221222
//|| ( argv[2]=='list' && !argv[3]) //will list default repository
222-
|| !(argv[2]=='install' || argv[2]=='i' || argv[2]=='materialize' || argv[2]=='new' || argv[2]=='list' || argv[2]=='uninstall')
223+
|| !(argv[2]=='install' || argv[2]=='i' || argv[2]=='materialize' || argv[2]=='new' || argv[2]=='list'
224+
|| argv[2]=='uninstall' || argv[2]=='update')
223225
)
224226
{
225227
console.log(' nodeclipse help');
@@ -237,6 +239,8 @@ if (argv.length === 2
237239
// console.log(' repositoryURL may be file e.g. jar:file:/D:/Workspaces/Nodeclipse-DEV/nodeclipse-1/org.nodeclipse.site/target/org.nodeclipse.site-0.10.0-SNAPSHOT.zip!/');
238240
console.log(' nodeclipse install <alias|exact.feature.name.feature.group> [...]');
239241
console.log(' nodeclipse install from <repository> <alias|exact.feature.name.feature.group> [...]');
242+
console.log(' nodeclipse uninstall <alias|exact.feature.name.feature.group> [...]');
243+
console.log(' nodeclipse update [from <repository>] <alias|exact.feature.name.feature.group> [...]');
240244
console.log(' nodeclipse install all from <repository> // BE CAREFUL WHAT YOU ASK FOR');
241245
// console.log(' nodeclipse install [-repository repositoryURL] <alias|exact.feature.name.feature.group> [...]');
242246
console.log(' nodeclipse materialize [from <repository>] to <folder>');
@@ -301,6 +305,15 @@ if (argv[2]=='list'){ // this does not work (from http://www.jshint.com/docs/):
301305
else if (argv[2]=='uninstall'){
302306
var command = 'uninstall';
303307
}
308+
else if (argv[2]=='update'){
309+
var command = 'update';
310+
if (argv[3]=='from'){// was || argv[3]=='-repository'
311+
if (argv[4]){
312+
repository = argv[4];
313+
startingIndex = 5;
314+
}
315+
}
316+
}
304317
//TODO nci new [from kepler] to e:/builder/eclipse1/
305318
else if (argv[2]=='materialize' || argv[2]=='new'){
306319
var command = 'materialize';
@@ -403,6 +416,8 @@ var optionsInstall = ['-nosplash', '-application', 'org.eclipse.equinox.p2.direc
403416
'-installIU', plugin, '-tag', plugin, '-vmargs', '-Declipse.p2.mirrors=false'];
404417
var optionsUninstall = ['-nosplash', '-application', 'org.eclipse.equinox.p2.director', '-repository', repository,
405418
'-uninstallIU', plugin, '-tag', plugin];
419+
var optionsUpdate = ['-nosplash', '-application', 'org.eclipse.equinox.p2.director', '-repository', repository,
420+
'-uninstallIU', plugin, '-installIU', plugin, '-tag', plugin, '-vmargs', '-Declipse.p2.mirrors=false'];
406421

407422
//DONE nci materialize from kepler to e:/builder/eclipse1/
408423

@@ -492,6 +507,8 @@ if ( command == 'list'){
492507
}
493508
} else if ( command == 'uninstall'){
494509
var spawned = spawning(what, optionsUninstall, log2console, onExitShowCode);
510+
} else if ( command == 'update'){
511+
var spawned = spawning(what, optionsUpdate, log2console, onExitShowCode);
495512
} else {
496513
console.log("Unexpected command "+command);
497514
console.log("Try nodeclipse help");

org.nodeclipse.ui/templates/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nodeclipse",
3-
"version": "0.10.10",
3+
"version": "0.11.0",
44
"description": "nodeclipse CLI - prepare Node.js project to be imported into Eclipse (Nodeclipse); Installer - eclipse plugin CLI installer",
55
"main": "copier.js",
66
"scripts": {

0 commit comments

Comments
 (0)