-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zFernand0 <[email protected]>
- Loading branch information
Showing
1 changed file
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
/* | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
|
||
const installSuccessMessage = | ||
"Zowe CLI has been successfully installed. " + | ||
function getImperative() { | ||
try { | ||
return require("@zowe/imperative"); | ||
} catch (err) { | ||
if (err.code === "ERR_MODULE_NOT_FOUND" || err.code === "MODULE_NOT_FOUND") { | ||
require("ts-node/register"); | ||
return require(require("path").resolve(__dirname, "../../../../imperative/packages/utilities/src/TextUtils")); | ||
} else { | ||
throw err; | ||
} | ||
} | ||
} | ||
|
||
function printSuccessMessage() { | ||
const imperative = getImperative(); | ||
|
||
const installSuccessMessage = "Zowe CLI has been successfully installed. " + | ||
"You can safely ignore all non-plug-in related errors and warnings. " + | ||
"Please check above for any plug-in related issues."; | ||
|
||
const Table = require("cli-table3"); | ||
const table = new Table({ | ||
chars: { | ||
top: "═", | ||
"top-left": "╔", | ||
"top-right": "╗", | ||
bottom: "═", | ||
"bottom-left": "╚", | ||
"bottom-right": "╝", | ||
left: "║", | ||
right: "║", | ||
}, | ||
colWidths: [require("yargs").terminalWidth() - 8], | ||
style: { "padding-left": 0, "padding-right": 0, head: [], border: [] }, | ||
wordWrap: true, | ||
}); | ||
table.push([installSuccessMessage]); | ||
console.log("\n" + table.toString() + "\n"); | ||
const table = imperative.TextUtils.getTable([[installSuccessMessage]], "yellow", undefined, false, true, true); | ||
console.log("\n" + table + "\n"); | ||
} | ||
|
||
printSuccessMessage(); |