...',
30 | '',
31 |
32 | ul('Common Commands:'),
33 |
34 | '',
35 |
36 | cyan('Main menu'),
37 | ' di',
38 | '',
39 |
40 | cyan('To set the DeployR server endpoint'),
41 | ' di endpoint',
42 | '',
43 |
44 | cyan('To log into DeployR'),
45 | ' di login',
46 | '',
47 |
48 | cyan('To install a pre-built example'),
49 | ' di install example',
50 | '',
51 |
52 | ul('Additional Commands'),
53 | ' di whoami',
54 | ' di logout',
55 | ' di about',
56 | ' di config',
57 | ' di users',
58 | ' di server'
59 | ];
--------------------------------------------------------------------------------
/lib/util/brand.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright (C) 2010-2016, Microsoft Corporation
3 | *
4 | * This program is licensed to you under the terms of Version 2.0 of the
5 | * Apache License. This program is distributed WITHOUT
6 | * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
7 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
8 | * Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) for more
9 | * details.
10 | */
11 |
12 | 'use strict';
13 |
14 | var chalk = require('chalk');
15 |
16 | /**
17 | * Welcome to the DeployR CLI `di` prompt intro.
18 | *
19 | * ________ .__ __________
20 | * \______ \ ____ ______ | | ____ ___.__.\______ \
21 | * | | \_/ __ \\____ \| | / _ < | | | _/
22 | * | ` \ ___/| |_> > |_( <_> )___ | | | \
23 | * /_______ /\___ > __/|____/\____// ____| |____|_ /
24 | * \/ \/|__| \/ \/
25 | *
26 | *
27 | * @mixin util/brand
28 | */
29 | module.exports = chalk.cyan([
30 | '',
31 | '________ .__. __________ ',
32 | '\\______ \\ ____ ______ | | ____ ___.__.\\______ \\ ',
33 | ' | | \\_/ __ \\\\____ \\| | / _ < | | | _/ ',
34 | ' | ` \\ ___/| |_> > |_( <_> )___ | | | \\ ',
35 | '/_______ /\\___ > __/|____/\\____// ____| |____|_ / ',
36 | ' \\/ \\/|__| \\/ \\\/ ',
37 | ''
38 | ].join('\n'));
--------------------------------------------------------------------------------
/lib/util/clear.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright (C) 2010-2016, Microsoft Corporation
3 | *
4 | * This program is licensed to you under the terms of Version 2.0 of the
5 | * Apache License. This program is distributed WITHOUT
6 | * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
7 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
8 | * Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) for more
9 | * details.
10 | */
11 |
12 | 'use strict';
13 |
14 | /**
15 | * Clears stdout and bring the cursor to postion 0,0.
16 | *
17 | * @mixin
18 | * @alias util/clear
19 | */
20 | module.exports = function clearScreen() {
21 | process.stdout.write("\u001b[2J\u001b[0;0H");
22 | };
--------------------------------------------------------------------------------
/lib/util/lang-type.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright (C) 2010-2016, Microsoft Corporation
3 | *
4 | * This program is licensed to you under the terms of Version 2.0 of the
5 | * Apache License. This program is distributed WITHOUT
6 | * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
7 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
8 | * Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) for more
9 | * details.
10 | */
11 |
12 | 'use strict';
13 |
14 | var Enum = require('enum'),
15 | langEnum = new Enum(['JS', 'JAVA', 'DOTNET'], 'LangType');
16 |
17 | /**
18 | * Defines the currently supported set of example `Languages`.
19 | *
20 | * @mixin
21 | * @alias util/lang-type
22 | */
23 | module.exports = {
24 | /**
25 | * Javascript Language
26 | */
27 | JS: langEnum.Javascript,
28 |
29 | /**
30 | * Java Language
31 | */
32 | JAVA: langEnum.JAVA,
33 |
34 | /**
35 | * .NET Language
36 | */
37 | DOTNET: langEnum.DOTNET,
38 |
39 | /**
40 | * Converts the string representation of the name to an equivalent
41 | * enumerated object.
42 | */
43 | parse: function(name) {
44 | if (!name || typeof name !== 'string') { return null; }
45 |
46 | if (name.indexOf('js-') > -1) {
47 | return this.JS;
48 | } else if (name.indexOf('java-') > -1) {
49 | return this.JAVA;
50 | } else if (name.indexOf('dotnet-') > -1) {
51 | return this.DOTNET;
52 | } else {
53 | return null;
54 | }
55 | }
56 | };
57 |
--------------------------------------------------------------------------------
/lib/util/spawn-command.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright (C) 2010-2016, Microsoft Corporation
3 | *
4 | * This program is licensed to you under the terms of Version 2.0 of the
5 | * Apache License. This program is distributed WITHOUT
6 | * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
7 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
8 | * Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) for more
9 | * details.
10 | */
11 |
12 | 'use strict';
13 |
14 | var _ = require('lodash'),
15 | spawn = require('cross-spawn');
16 |
17 | /**
18 | * Normalize a command across operating systems and spawn it.
19 | *
20 | * @mixin
21 | * @alias util/spawn-command
22 | */
23 | module.exports = function spawnCommand(command, args, opt) {
24 | return spawn(command, args, _.defaults({ stdio: 'inherit' }, opt || {}));
25 | };
26 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "deployr-cli",
3 | "version": "1.1.2",
4 | "description": "The DeployR command line interface, a tool for running useful DeployR utilities.",
5 | "private": false,
6 | "keywords": [
7 | "cli",
8 | "deployr",
9 | "rbroker",
10 | "R",
11 | "rro",
12 | "mro",
13 | "mrs",
14 | "Microsoft",
15 | "statistics"
16 | ],
17 | "author": "DeployR - Microsoft Corporation",
18 | "contributors": [
19 | "Sean Wells"
20 | ],
21 | "repository": {
22 | "type": "git",
23 | "url": "git://github.com/microsoft/deployr-cli.git"
24 | },
25 | "homepage": "http://go.microsoft.com/fwlink/?LinkID=692163",
26 | "dependencies": {
27 | "chalk": "^1.0.0",
28 | "char-spinner": "^1.0.1",
29 | "complete": "0.3.1",
30 | "cross-spawn": "^0.2.3",
31 | "deployr": "^8.0.5",
32 | "download": "^4.4.3",
33 | "download-status": "^2.2.1",
34 | "enum": "^0.2.6",
35 | "flatiron": "0.3.8",
36 | "flatiron-cli-config": "0.1.4",
37 | "inquirer": "^0.8.0",
38 | "lodash": "^2.4.1",
39 | "opn": "^1.0.1",
40 | "pkginfo": "0.3.0",
41 | "request": "^2.40.0",
42 | "require-analyzer": "0.5.0",
43 | "shelljs": "^0.3.0"
44 | },
45 | "devDependencies": {
46 | "jsdoc": "^3.3.0-alpha13",
47 | "jshint": "^2.5.11"
48 | },
49 | "bin": {
50 | "di": "bin/di"
51 | },
52 | "scripts": {
53 | "doc": "node_modules/.bin/jsdoc -c jsdoc.json README.md",
54 | "test": "echo \"Error: no test specified\" && exit 1"
55 | },
56 | "main": "di.js",
57 | "engines": {
58 | "node": ">= 0.10.0"
59 | },
60 | "license": "Apache-2.0",
61 | "bugs": {
62 | "url": "https://github.com/microsoft/deployr-cli/issues"
63 | }
64 | }
65 |
--------------------------------------------------------------------------------