MCPcopy
hub / github.com/Unitech/pm2 / uninstall

Function uninstall

lib/completion.js:170–188  ·  view source on GitHub ↗
(name, completer, cb)

Source from the content-addressed store, hash-verified

168}
169
170function uninstall(name, completer, cb) {
171 var markerIn = '\n\n###-begin-' + name + '-completion-###',
172 markerOut = '###-end-' + name + '-completion-###\n';
173
174 readRc(completer, function(err, file) {
175 if(err) return cb(err);
176
177 var part = file.split(markerIn)[1];
178 if(!part) {
179 return cb(null, ' ✗ ' + completer + ' tab-completion has been already uninstalled. Do nothing.');
180 }
181
182 part = markerIn + part.split(markerOut)[0] + markerOut;
183 writeRc(file.replace(part, ''), function(err) {
184 if(err) return cb(err);
185 return cb(null, ' ✓ ' + completer + ' tab-completion uninstalled.');
186 });
187 });
188}
189
190function readRc(completer, cb) {
191 var file = '.' + process.env.SHELL.match(/\/bin\/(\w+)/)[1] + 'rc',

Callers 1

completion.jsFile · 0.70

Calls 3

readRcFunction · 0.85
cbFunction · 0.85
writeRcFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…