-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefault-input.js
More file actions
62 lines (51 loc) · 2.51 KB
/
default-input.js
File metadata and controls
62 lines (51 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function checkJson(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
exports.github = {};
exports.server = {};
exports.archive = {};
exports.publishing = {
buckets: {}
};
exports.github.type = prompt('GitHub account type', package.github.type);
exports.github.account_name = prompt('Account name', package.github.account_name);
exports.github.access_token = prompt('Github access token', package.github.access_token);
exports.github.login_method = prompt('Connect to GitHub with https or ssh?', package.github.login_method);
exports.github.private_repos = prompt('Create private repos by default?', String(package.github.private_repos), function(repos){
var isJson = checkJson(repos);
if (!isJson) console.error('ERROR: Please enter either true or false.');
repos = JSON.parse(repos);
return repos;
});
exports.server.url = prompt('Kestrel server url:port', package.server.url);
exports.server.sync_deploy_trigger = prompt('Sync trigger', package.server.sync_deploy_trigger);
exports.server.hard_deploy = {};
var hard_trigger_enabled;
exports.server.hard_deploy.enabled = prompt('Enable hard trigger?', String(package.server.hard_deploy.enabled), function(enabled){
var isJson = checkJson(enabled);
if (!isJson) console.error('ERROR: Please enter either true or false.');
enabled = hard_trigger_enabled = JSON.parse(enabled);
return enabled;
});
exports.server.hard_deploy.trigger = function(cb){
response = null;
if (hard_trigger_enabled) response = prompt('Hard trigger', package.server.hard_deploy.trigger);
cb(null, response);
};
exports.publishing.remote_path = prompt('Default S3 folder to publish into', package.publishing.remote_path);
var is_moment_template = package.publishing.is_moment_template || false
exports.publishing.is_moment_template = prompt('Is the remote path a date template?', String(is_moment_template), function(isMoment){
var isJson = checkJson(isMoment);
if (!isJson) console.error('ERROR: Please enter either true or false.');
isMoment = JSON.parse(isMoment);
return isMoment;
});
exports.publishing.buckets.prod = prompt('What\'s the name of your production bucket?', package.publishing.buckets.prod);
exports.publishing.buckets.staging = prompt('What\'s the name of your staging bucket?', package.publishing.buckets.staging);
exports.archive.repo_name = prompt('Optional archive repo name', package.archive.repo_name);
exports.timezone = prompt('What timezone are you in?', package.timezone);