Skip to content

Commit

Permalink
feat: Remove Watch command (#296)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This removes the watch command

This feature was just wrapping the `oc rsync` command, which nodeshift probably shouldn't be doing.  It is better to just use that command instead

fixes #280
  • Loading branch information
helio-frota authored and lholmquist committed Mar 25, 2019
1 parent 9ab08b5 commit fa79166
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 367 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ By default, if you run just `nodeshift`, it will run the `deploy` goal, which is

**undeploy** - removes resources that were deployed with the apply-resource command

**watch** - connect to a running pod. Also watches your local files for changes to sync with the remote pod


### `.nodeshift` Directory

Expand Down Expand Up @@ -205,9 +203,6 @@ Shows the below help
nodeshift resource resource command
nodeshift apply-resource apply resource command
nodeshift undeploy undeploy resources
nodeshift watch connect to running Pod and watch local
filesystem for changes to sync with
remote Pod

Options:
--version Show version number [boolean]
Expand Down
4 changes: 0 additions & 4 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const resourceGoal = require('../lib/goals/resource');
const buildGoal = require('../lib/goals/build');
const applyResources = require('../lib/goals/apply-resources');
const undeployGoal = require('../lib/goals/undeploy');
const watchSyncGoal = require('../lib/goals/watch-spawn');
const namespace = require('../lib/namespace');

/**
Expand Down Expand Up @@ -67,9 +66,6 @@ module.exports = async function run (options) {
response.resources = await resourceGoal(config);
response.appliedResources = await applyResources(config, response.resources);
break;
case 'watch':
await watchSyncGoal(config);
break;
default:
throw new TypeError(`Unexpected command: ${options.cmd}`);
}
Expand Down
1 change: 0 additions & 1 deletion bin/nodeshift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ yargs
.command('resource', 'resource command', { cmd: { default: 'resource' } }, commandHandler)
.command('apply-resource', 'apply resource command', { cmd: { default: 'apply-resource' } }, commandHandler)
.command('undeploy [removeAll]', 'undeploy resources', { cmd: { default: 'undeploy' } }, commandHandler)
.command('watch', 'watch resources', { cmd: { default: 'watch' } }, commandHandler)
.option('projectLocation', {
describe: 'change the default location of the project',
type: 'string'
Expand Down
46 changes: 0 additions & 46 deletions lib/goals/watch-spawn.js

This file was deleted.

96 changes: 0 additions & 96 deletions lib/goals/watch-sync.js

This file was deleted.

32 changes: 0 additions & 32 deletions test/cli-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,38 +261,6 @@ test('build goal - with namespace', (t) => {
});
});

test('watch goal', (t) => {
const cli = proxyquire('../bin/cli', {
'../lib/nodeshift-config': () => {
return Promise.resolve({});
},
'../lib/goals/resource': (config) => {
t.fail('should not be here for the watch goal');
return Promise.resolve();
},
'../lib/goals/build': (config) => {
t.fail('should not be here for the watch goal');
return Promise.resolve();
},
'../lib/goals/apply-resources': (config) => {
t.fail('should not be here for the watch goal');
return Promise.resolve();
},
'../lib/goals/undeploy': (config) => {
t.fail('should not be here for the watch goal');
return Promise.resolve();
},
'../lib/goals/watch-spawn': (config) => {
t.pass('should be here for the watch goal');
return Promise.resolve();
}
});

cli({ cmd: 'watch' }).then(() => {
t.end();
});
});

test('error', (t) => {
const cli = proxyquire('../bin/cli', {
'../lib/nodeshift-config': () => {
Expand Down

0 comments on commit fa79166

Please sign in to comment.