2017-12-20 21:46:01 +00:00
|
|
|
/*
|
2019-04-02 17:01:28 +00:00
|
|
|
Copyright 2016-2019 Balena
|
2016-03-28 13:21:25 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
2017-12-20 21:46:01 +00:00
|
|
|
*/
|
2016-03-28 13:21:25 +00:00
|
|
|
|
2018-10-19 14:38:50 +00:00
|
|
|
import * as BalenaSync from 'balena-sync';
|
2019-04-02 17:01:28 +00:00
|
|
|
import { CommandDefinition } from 'capitano';
|
|
|
|
import { stripIndent } from 'common-tags';
|
|
|
|
|
|
|
|
export = deprecateSyncCmd(BalenaSync.capitano('balena-cli'));
|
|
|
|
|
|
|
|
const deprecationMsg = stripIndent`\
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
Deprecation notice: please note that \`balena sync\` is deprecated and will
|
|
|
|
be removed in a future release of the CLI. We are working on an exciting
|
|
|
|
"live push" alternative: https://github.com/balena-io-modules/livepush
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
`;
|
|
|
|
|
|
|
|
function deprecateSyncCmd(syncCmd: CommandDefinition): CommandDefinition {
|
|
|
|
syncCmd.primary = false;
|
|
|
|
syncCmd.description = syncCmd.description.replace(
|
|
|
|
'(beta)',
|
|
|
|
'[deprecated: see "help sync"]',
|
|
|
|
);
|
|
|
|
syncCmd.help = deprecationMsg + '\n\n' + syncCmd.help;
|
|
|
|
const originalAction = syncCmd.action;
|
|
|
|
syncCmd.action = (params, options, done): void => {
|
|
|
|
console.log(deprecationMsg);
|
|
|
|
originalAction(params, options, done);
|
|
|
|
};
|
|
|
|
return syncCmd;
|
|
|
|
}
|