@corva/create-app 0.88.0-rc.0 → 0.89.0-1
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.
|
@@ -24,13 +24,18 @@ async function deleteAppPackage({ api, appId, appPkgVersion }) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
function getGithubUsernameActor() {
|
|
28
|
+
// It is fetched from CI github.actor variable
|
|
28
29
|
return process.env.githubUsername || null;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
function getGitConfigUsername() {
|
|
32
33
|
try {
|
|
33
|
-
|
|
34
|
+
let username = execSync('git config user.name').toString().trim();
|
|
35
|
+
|
|
36
|
+
if (!username) {
|
|
37
|
+
username = execSync('git config --global user.name').toString().trim();
|
|
38
|
+
}
|
|
34
39
|
|
|
35
40
|
return username || null;
|
|
36
41
|
} catch (error) {
|
|
@@ -40,21 +45,6 @@ function getGitConfigUsername() {
|
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
async function promptForUsername() {
|
|
44
|
-
const readline = require('readline');
|
|
45
|
-
const rl = readline.createInterface({
|
|
46
|
-
input: process.stdin,
|
|
47
|
-
output: process.stdout,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
return new Promise((resolve) => {
|
|
51
|
-
rl.question('Please enter your GitHub username: ', (answer) => {
|
|
52
|
-
rl.close();
|
|
53
|
-
resolve(answer);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
48
|
export const UPLOAD_ZIP_TO_CORVA_STEP = {
|
|
59
49
|
message: RELEASE.uploadApp,
|
|
60
50
|
/**
|
|
@@ -68,23 +58,12 @@ export const UPLOAD_ZIP_TO_CORVA_STEP = {
|
|
|
68
58
|
|
|
69
59
|
form.append('package', createReadStream(resolve(dirName, zipFileName)), 'package.zip');
|
|
70
60
|
|
|
71
|
-
let githubUsername =
|
|
61
|
+
let githubUsername = getGithubUsernameActor();
|
|
72
62
|
|
|
73
63
|
if (!githubUsername) {
|
|
74
64
|
githubUsername = getGitConfigUsername();
|
|
75
65
|
}
|
|
76
66
|
|
|
77
|
-
if (!githubUsername) {
|
|
78
|
-
try {
|
|
79
|
-
githubUsername = await Promise.race([
|
|
80
|
-
promptForUsername(),
|
|
81
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error('Prompt timed out')), 10000)),
|
|
82
|
-
]);
|
|
83
|
-
} catch (error) {
|
|
84
|
-
logger.log('Username prompt timed out or failed: ' + error.message);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
67
|
form.append('github_username', githubUsername);
|
|
89
68
|
|
|
90
69
|
const { id: packageId, isDeletedDueToLimit } = await api.uploadPackages(appKey, form);
|