@codeleap/cli 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +1 -0
- package/dist/commands/init.js +68 -26
- package/dist/commands/keystoresAndroid.js +128 -0
- package/dist/commands/rename.js +154 -0
- package/dist/index.js +6 -4
- package/dist/lib/android/index.js +18 -0
- package/dist/lib/android/keystore.js +27 -0
- package/dist/lib/android/rename.js +266 -0
- package/dist/lib/android/utils.js +67 -0
- package/dist/lib/firebase.js +19 -0
- package/dist/lib/index.js +22 -1
- package/dist/lib/ios/index.js +18 -0
- package/dist/lib/ios/rename.js +160 -0
- package/dist/lib/ios/utils.js +28 -0
- package/dist/lib/spinner.js +11 -2
- package/dist/lib/utils.js +69 -0
- package/dist/lib/walk.js +130 -0
- package/package.json +43 -31
- package/yarn-error.log +25945 -0
- package/dist/index.d.ts +0 -1
- package/src/commands/init.ts +0 -31
- package/src/index.ts +0 -13
- package/src/lib/Command.ts +0 -10
- package/src/lib/index.ts +0 -3
- package/src/lib/spinner.ts +0 -21
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
index.ts eol=lf
|
package/dist/commands/init.js
CHANGED
|
@@ -35,45 +35,87 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
38
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
42
|
exports.initCommand = void 0;
|
|
40
|
-
|
|
43
|
+
// import { waitFor } from '@codeleap/common'
|
|
41
44
|
var Command_1 = require("../lib/Command");
|
|
42
|
-
var spinner_1 = require("../lib/spinner");
|
|
43
45
|
var lib_1 = require("../lib");
|
|
46
|
+
var generate_password_1 = __importDefault(require("generate-password"));
|
|
47
|
+
var keystore_1 = require("../lib/android/keystore");
|
|
48
|
+
function genKeystore(type) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var pass, alias, keystoresDir, fileName;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
pass = generate_password_1.default.generate({
|
|
55
|
+
length: 26,
|
|
56
|
+
lowercase: true,
|
|
57
|
+
numbers: true,
|
|
58
|
+
strict: true,
|
|
59
|
+
symbols: true,
|
|
60
|
+
uppercase: true,
|
|
61
|
+
});
|
|
62
|
+
alias = type;
|
|
63
|
+
keystoresDir = lib_1.path.join(lib_1.cwd, 'android', 'app', 'keystores');
|
|
64
|
+
fileName = "".concat(type, ".keystore");
|
|
65
|
+
return [4 /*yield*/, (0, lib_1.subprocess)('Generating keystore', 'keytool', [
|
|
66
|
+
'-genkeypair ',
|
|
67
|
+
'-v',
|
|
68
|
+
'-storetype ',
|
|
69
|
+
'PKCS12 ',
|
|
70
|
+
'-keystore ',
|
|
71
|
+
fileName,
|
|
72
|
+
'-alias ',
|
|
73
|
+
alias,
|
|
74
|
+
'-keyalg',
|
|
75
|
+
'RSA',
|
|
76
|
+
'-keysize',
|
|
77
|
+
'2048',
|
|
78
|
+
'-storepass',
|
|
79
|
+
pass,
|
|
80
|
+
'-keypass',
|
|
81
|
+
pass,
|
|
82
|
+
'-validity ',
|
|
83
|
+
'11000',
|
|
84
|
+
'-dname',
|
|
85
|
+
'CN=Victor Rothberg, OU=Development, O=Codeleap, L=London, ST=Greater London, C=GB',
|
|
86
|
+
], {
|
|
87
|
+
cwd: keystoresDir,
|
|
88
|
+
})];
|
|
89
|
+
case 1:
|
|
90
|
+
_a.sent();
|
|
91
|
+
return [2 /*return*/, {
|
|
92
|
+
'storePassword': pass,
|
|
93
|
+
'keyAlias': alias,
|
|
94
|
+
'keyPassword': pass,
|
|
95
|
+
'file': lib_1.path.join(keystoresDir, fileName),
|
|
96
|
+
'keyname': fileName,
|
|
97
|
+
keystoresDir: keystoresDir,
|
|
98
|
+
}];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
44
103
|
exports.initCommand = (0, Command_1.codeleapCommand)({
|
|
45
|
-
name: '
|
|
104
|
+
name: 'keystores-android',
|
|
46
105
|
parameters: [],
|
|
47
106
|
alias: 'i',
|
|
48
107
|
}, function (_a) {
|
|
49
108
|
var _ = _a._;
|
|
50
109
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
-
var
|
|
110
|
+
var releaseCredentials, configFile;
|
|
52
111
|
return __generator(this, function (_b) {
|
|
53
112
|
switch (_b.label) {
|
|
54
|
-
case 0: return [4 /*yield*/,
|
|
55
|
-
{
|
|
56
|
-
message: "What's your name?",
|
|
57
|
-
default: 'Codeleap',
|
|
58
|
-
name: 'name',
|
|
59
|
-
},
|
|
60
|
-
])];
|
|
113
|
+
case 0: return [4 /*yield*/, genKeystore('release')];
|
|
61
114
|
case 1:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
case 0: return [4 /*yield*/, (0, common_1.waitFor)(10000)];
|
|
67
|
-
case 1:
|
|
68
|
-
_a.sent();
|
|
69
|
-
console.log(lib_1.chalk.greenBright(answers.name + ', your awesomeness level is:'));
|
|
70
|
-
console.log(lib_1.chalk.yellow(lib_1.figlet.textSync('Cacetinho')));
|
|
71
|
-
return [2 /*return*/];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}); }, {
|
|
75
|
-
name: 'Measuring your awesomeness...',
|
|
76
|
-
});
|
|
115
|
+
releaseCredentials = _b.sent();
|
|
116
|
+
configFile = new keystore_1.AndroidConfigFile(lib_1.path.join(releaseCredentials.keystoresDir, 'config.json'));
|
|
117
|
+
configFile.setKey(releaseCredentials.keyname, releaseCredentials);
|
|
118
|
+
console.log("Generated ".concat(releaseCredentials.keyname, " at ").concat(releaseCredentials.keystoresDir, ". \n Upload this file as a document to 1password, and add the following to it's \"notes\" section.\n ").concat(JSON.stringify(configFile.data, null, 1), "\n "));
|
|
77
119
|
return [2 /*return*/];
|
|
78
120
|
}
|
|
79
121
|
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.generateReleaseKey = void 0;
|
|
43
|
+
// import { waitFor } from '@codeleap/common'
|
|
44
|
+
var Command_1 = require("../lib/Command");
|
|
45
|
+
var lib_1 = require("../lib");
|
|
46
|
+
var generate_password_1 = __importDefault(require("generate-password"));
|
|
47
|
+
var keystore_1 = require("../lib/android/keystore");
|
|
48
|
+
function genKeystore(type) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var pass, alias, keystoresDir, fileName;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
pass = generate_password_1.default.generate({
|
|
55
|
+
length: 26,
|
|
56
|
+
lowercase: true,
|
|
57
|
+
numbers: true,
|
|
58
|
+
strict: true,
|
|
59
|
+
symbols: true,
|
|
60
|
+
uppercase: true,
|
|
61
|
+
});
|
|
62
|
+
alias = type;
|
|
63
|
+
keystoresDir = lib_1.path.join(lib_1.cwd, 'android', 'app', 'keystores');
|
|
64
|
+
fileName = "".concat(type, ".keystore");
|
|
65
|
+
return [4 /*yield*/, (0, lib_1.subprocess)('Generating keystore', 'keytool', [
|
|
66
|
+
'-genkeypair ',
|
|
67
|
+
'-v',
|
|
68
|
+
'-storetype',
|
|
69
|
+
'PKCS12',
|
|
70
|
+
'-keystore',
|
|
71
|
+
fileName,
|
|
72
|
+
'-alias',
|
|
73
|
+
alias,
|
|
74
|
+
'-keyalg',
|
|
75
|
+
'RSA',
|
|
76
|
+
'-keysize',
|
|
77
|
+
'2048',
|
|
78
|
+
'-storepass',
|
|
79
|
+
pass,
|
|
80
|
+
'-keypass',
|
|
81
|
+
pass,
|
|
82
|
+
'-validity',
|
|
83
|
+
'11000',
|
|
84
|
+
'-dname',
|
|
85
|
+
'CN=Victor Rothberg, OU=Development, O=Codeleap, L=London, ST=Greater London, C=GB',
|
|
86
|
+
], {
|
|
87
|
+
cwd: keystoresDir,
|
|
88
|
+
})];
|
|
89
|
+
case 1:
|
|
90
|
+
_a.sent();
|
|
91
|
+
return [2 /*return*/, {
|
|
92
|
+
'storePassword': pass,
|
|
93
|
+
'keyAlias': alias,
|
|
94
|
+
'keyPassword': pass,
|
|
95
|
+
'file': lib_1.path.join(keystoresDir, fileName),
|
|
96
|
+
'keyname': fileName,
|
|
97
|
+
keystoresDir: keystoresDir,
|
|
98
|
+
}];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
exports.generateReleaseKey = (0, Command_1.codeleapCommand)({
|
|
104
|
+
name: 'keystores-android',
|
|
105
|
+
parameters: [],
|
|
106
|
+
alias: 'i',
|
|
107
|
+
}, function (_a) {
|
|
108
|
+
var _ = _a._;
|
|
109
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
+
var releaseCredentials, configFile, log;
|
|
111
|
+
return __generator(this, function (_b) {
|
|
112
|
+
switch (_b.label) {
|
|
113
|
+
case 0: return [4 /*yield*/, genKeystore('release')];
|
|
114
|
+
case 1:
|
|
115
|
+
releaseCredentials = _b.sent();
|
|
116
|
+
configFile = new keystore_1.AndroidConfigFile(lib_1.path.join(releaseCredentials.keystoresDir, 'config.json'));
|
|
117
|
+
configFile.setKey(releaseCredentials.keyname, releaseCredentials);
|
|
118
|
+
log = [
|
|
119
|
+
"Generated ".concat(releaseCredentials.keyname, " at ").concat(releaseCredentials.keystoresDir, "."),
|
|
120
|
+
"Upload this file as a document to 1Password, and add the following to it's \"notes\" section",
|
|
121
|
+
JSON.stringify(configFile.data, null, 1),
|
|
122
|
+
].join('\n');
|
|
123
|
+
console.log(log);
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.renameMobileCommand = void 0;
|
|
54
|
+
// import { waitFor } from '@codeleap/common'
|
|
55
|
+
var Command_1 = require("../lib/Command");
|
|
56
|
+
var spinner_1 = require("../lib/spinner");
|
|
57
|
+
var fs_1 = __importDefault(require("fs"));
|
|
58
|
+
var path_1 = __importDefault(require("path"));
|
|
59
|
+
var lib_1 = require("../lib");
|
|
60
|
+
var ios_1 = require("../lib/ios");
|
|
61
|
+
require("../lib/firebase");
|
|
62
|
+
var commandName = 'rename-mobile';
|
|
63
|
+
exports.renameMobileCommand = (0, Command_1.codeleapCommand)({
|
|
64
|
+
name: commandName,
|
|
65
|
+
parameters: [
|
|
66
|
+
'[new_name]',
|
|
67
|
+
],
|
|
68
|
+
help: {
|
|
69
|
+
description: 'Command for easily renaming ios and/or android app names consistently',
|
|
70
|
+
examples: [
|
|
71
|
+
"codeleap ".concat(commandName, " myAppName --ios # renames only ios folder"),
|
|
72
|
+
"codeleap ".concat(commandName, " myAppName --android # renames only android folder"),
|
|
73
|
+
"codeleap ".concat(commandName, " myAppName --android --ios # renames both folders"),
|
|
74
|
+
"codeleap ".concat(commandName, " myAppName --android --ios # Will show the diff in \"previous -> new\" format"),
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
flags: {
|
|
78
|
+
ios: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
description: 'Enables renaming of ios folder contents',
|
|
81
|
+
},
|
|
82
|
+
android: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
description: 'Enables renaming of android folder contents',
|
|
85
|
+
},
|
|
86
|
+
dry: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
description: 'Will not alter anything, only show the difference',
|
|
89
|
+
},
|
|
90
|
+
displayOnly: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
description: 'Will not alter the bundle identifier',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
}, function (argv) { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
+
var flags, _, name, answers, androidFolder_1, iosFolder_1, appJsonPath, appJson;
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
flags = argv.flags, _ = argv._;
|
|
101
|
+
name = _.new_name;
|
|
102
|
+
if (!!name) return [3 /*break*/, 2];
|
|
103
|
+
return [4 /*yield*/, lib_1.inquirer.prompt([
|
|
104
|
+
{
|
|
105
|
+
message: "Please insert the new name.",
|
|
106
|
+
name: 'name',
|
|
107
|
+
},
|
|
108
|
+
])];
|
|
109
|
+
case 1:
|
|
110
|
+
answers = _a.sent();
|
|
111
|
+
name = answers.name;
|
|
112
|
+
_a.label = 2;
|
|
113
|
+
case 2:
|
|
114
|
+
if (flags.android) {
|
|
115
|
+
androidFolder_1 = path_1.default.join(lib_1.cwd, 'android');
|
|
116
|
+
(0, spinner_1.spinWhileNotCompleted)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
|
+
return __generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0: return [4 /*yield*/, (0, lib_1.renameAndroid)(androidFolder_1, name, {
|
|
120
|
+
changeBundle: !flags.displayOnly,
|
|
121
|
+
})];
|
|
122
|
+
case 1:
|
|
123
|
+
_a.sent();
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}); }, {
|
|
128
|
+
name: 'Renaming android...',
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (flags.ios) {
|
|
132
|
+
iosFolder_1 = path_1.default.join(lib_1.cwd, 'ios');
|
|
133
|
+
(0, spinner_1.spinWhileNotCompleted)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0: return [4 /*yield*/, (0, ios_1.renameIos)(iosFolder_1, name, {
|
|
137
|
+
changeBundle: !flags.displayOnly,
|
|
138
|
+
})];
|
|
139
|
+
case 1:
|
|
140
|
+
_a.sent();
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}); }, {
|
|
145
|
+
name: 'Renaming iOS...',
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
appJsonPath = path_1.default.join(lib_1.cwd, 'app.json');
|
|
149
|
+
appJson = JSON.parse(fs_1.default.readFileSync(appJsonPath).toString());
|
|
150
|
+
fs_1.default.writeFileSync(appJsonPath, JSON.stringify(__assign(__assign({}, appJson), { name: name })));
|
|
151
|
+
return [2 /*return*/];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}); });
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
var cleye_1 = require("cleye");
|
|
5
|
-
var
|
|
5
|
+
var keystoresAndroid_1 = require("./commands/keystoresAndroid");
|
|
6
|
+
var rename_1 = require("./commands/rename");
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
8
|
+
var packageJson = require('../package.json');
|
|
6
9
|
(0, cleye_1.cli)({
|
|
7
10
|
name: 'codeleap',
|
|
8
|
-
commands: [
|
|
9
|
-
|
|
10
|
-
],
|
|
11
|
+
commands: [keystoresAndroid_1.generateReleaseKey, rename_1.renameMobileCommand],
|
|
12
|
+
version: packageJson.version,
|
|
11
13
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./rename"), exports);
|
|
18
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AndroidConfigFile = void 0;
|
|
4
|
+
var utils_1 = require("../utils");
|
|
5
|
+
var AndroidConfigFile = /** @class */ (function () {
|
|
6
|
+
function AndroidConfigFile(path) {
|
|
7
|
+
this.path = path;
|
|
8
|
+
this.data = {};
|
|
9
|
+
if (utils_1.fs.existsSync(path)) {
|
|
10
|
+
this.data = JSON.parse(utils_1.fs.readFileSync(path).toString());
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
AndroidConfigFile.prototype.setKey = function (key, value) {
|
|
14
|
+
var keyAlias = value.keyAlias, keyPassword = value.keyPassword, storePassword = value.storePassword;
|
|
15
|
+
this.data[key] = {
|
|
16
|
+
keyAlias: keyAlias,
|
|
17
|
+
keyPassword: keyPassword,
|
|
18
|
+
storePassword: storePassword,
|
|
19
|
+
};
|
|
20
|
+
this.save();
|
|
21
|
+
};
|
|
22
|
+
AndroidConfigFile.prototype.save = function () {
|
|
23
|
+
utils_1.fs.writeFileSync(this.path, JSON.stringify(this.data, null, 2));
|
|
24
|
+
};
|
|
25
|
+
return AndroidConfigFile;
|
|
26
|
+
}());
|
|
27
|
+
exports.AndroidConfigFile = AndroidConfigFile;
|