-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
…tion Add message for discontinuation of Telerik Platform
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "lib/common"] | ||
path = lib/common | ||
url = https://github.com/telerik/mobile-cli-lib.git | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,23 @@ | ||
#!/usr/bin/env node | ||
|
||
"use strict"; | ||
var path = require("path"), | ||
node = require("../package.json").engines.node, | ||
pathToLib = path.join(__dirname, "..", "lib"), | ||
pathToCommon = path.join(pathToLib, "common"); | ||
var versionValidator = require("../lib/version-validator"); | ||
var os = require("os"); | ||
|
||
require(path.join(pathToCommon, "verify-node-version")).verifyNodeVersion(node, "AppBuilder", ["^4.0.0", "^5.0.0"]); | ||
|
||
var pathToCliExecutable = path.join(pathToLib, "appbuilder-cli.js"); | ||
|
||
var nodeArgs = require(path.join(pathToCommon, "scripts", "node-args")).getNodeArgs(); | ||
|
||
if (nodeArgs.length) { | ||
// We need custom args for Node process, so pass them here. | ||
var childProcess = require("child_process"); | ||
var args = process.argv; | ||
|
||
// Remove `node` and `appbuilder` from the arguments. | ||
args.shift(); | ||
args.shift(); | ||
|
||
args.unshift(pathToCliExecutable); | ||
function printRedText(message) { | ||
console.log(`\x1B[31;1m${message}\x1B[0m`) | ||
} | ||
|
||
args = nodeArgs.concat(args); | ||
function printYellowText(message) { | ||
console.log(`\x1B[33;1m${message}\x1B[0m`) | ||
} | ||
|
||
var nodeProcess = childProcess.spawn(process.execPath, args, { stdio: "inherit" }); | ||
return versionValidator.ensureUpToDate() | ||
.then(() => { | ||
// Now print the information. | ||
printRedText("The Telerik Platform product is retired as of May 10, 2018. "); | ||
printRedText("For more information about the discontinuation and how you can recover your apps or data, please see the full announcement here: https://www.telerik.com/platform-next-level"); | ||
|
||
nodeProcess.on("close", function(code) { | ||
// We need this handler so if command fails, we'll exit with same exit code as CLI. | ||
process.exit(code); | ||
printYellowText(`${os.EOL}Telerik recommends NativeScript Sidekick (https://www.nativescript.org/nativescript-sidekick) for developing modern, cross-platform mobile apps with web technologies like JavaScript, Angular, or Vue.js, and Kinvey (https://www.kinvey.com/) for hosting critical business back-end in the cloud.`); | ||
process.exit(127); | ||
}); | ||
} else { | ||
require(pathToCliExecutable); | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.