backport 7.3.3 → 7.3.6
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/dist/backportRun.js +19 -12
- package/dist/services/github/v4/apiRequestV4.d.ts +3 -3
- package/dist/services/github/v4/throwOnInvalidAccessToken.js +1 -1
- package/dist/services/remoteConfig.js +1 -1
- package/dist/ui/getCommits.js +6 -1
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +1 -1
package/dist/backportRun.js
CHANGED
|
@@ -21,6 +21,7 @@ const setupRepo_1 = require("./ui/setupRepo");
|
|
|
21
21
|
async function backportRun(processArgs, optionsFromModule = {}) {
|
|
22
22
|
const argv = (0, yargs_parser_1.default)(processArgs);
|
|
23
23
|
const ci = argv.ci ?? optionsFromModule.ci;
|
|
24
|
+
const ls = argv.ls ?? optionsFromModule.ls;
|
|
24
25
|
const logFilePath = argv.logFilePath ?? optionsFromModule.logFilePath;
|
|
25
26
|
(0, logger_1.initLogger)({ ci, logFilePath });
|
|
26
27
|
// don't show spinner for yargs commands that exit the process without stopping the spinner first
|
|
@@ -81,18 +82,8 @@ async function backportRun(processArgs, optionsFromModule = {}) {
|
|
|
81
82
|
backportResponse,
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
|
-
if (
|
|
85
|
-
(
|
|
86
|
-
}
|
|
87
|
-
else if (e instanceof Error) {
|
|
88
|
-
// output
|
|
89
|
-
(0, logger_1.consoleLog)('\n');
|
|
90
|
-
(0, logger_1.consoleLog)(chalk_1.default.bold('⚠️ Ouch! An unhandled error occured 😿'));
|
|
91
|
-
(0, logger_1.consoleLog)(e.stack ? e.stack : e.message);
|
|
92
|
-
(0, logger_1.consoleLog)('Please open an issue in https://github.com/sqren/backport/issues or contact me directly on https://twitter.com/sorenlouv');
|
|
93
|
-
(0, logger_1.consoleLog)(chalk_1.default.italic(`For additional details see the logs: ${(0, env_1.getLogfilePath)({
|
|
94
|
-
logFilePath,
|
|
95
|
-
})}`));
|
|
85
|
+
if (!ls) {
|
|
86
|
+
outputError({ e, logFilePath });
|
|
96
87
|
}
|
|
97
88
|
logger_1.logger.error('Unhandled exception', e);
|
|
98
89
|
process.exitCode = 1;
|
|
@@ -100,3 +91,19 @@ async function backportRun(processArgs, optionsFromModule = {}) {
|
|
|
100
91
|
}
|
|
101
92
|
}
|
|
102
93
|
exports.backportRun = backportRun;
|
|
94
|
+
function outputError({ e, logFilePath, }) {
|
|
95
|
+
if (e instanceof HandledError_1.HandledError || e instanceof apiRequestV4_1.GithubV4Exception) {
|
|
96
|
+
(0, logger_1.consoleLog)(e.message);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (e instanceof Error) {
|
|
100
|
+
// output
|
|
101
|
+
(0, logger_1.consoleLog)('\n');
|
|
102
|
+
(0, logger_1.consoleLog)(chalk_1.default.bold('⚠️ Ouch! An unhandled error occured 😿'));
|
|
103
|
+
(0, logger_1.consoleLog)(e.stack ? e.stack : e.message);
|
|
104
|
+
(0, logger_1.consoleLog)('Please open an issue in https://github.com/sqren/backport/issues or contact me directly on https://twitter.com/sorenlouv');
|
|
105
|
+
(0, logger_1.consoleLog)(chalk_1.default.italic(`For additional details see the logs: ${(0, env_1.getLogfilePath)({
|
|
106
|
+
logFilePath,
|
|
107
|
+
})}`));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -15,7 +15,7 @@ function throwOnInvalidAccessToken({ error, repoOwner, repoName, }) {
|
|
|
15
15
|
const statusCode = error.githubResponse.status;
|
|
16
16
|
switch (statusCode) {
|
|
17
17
|
case 200: {
|
|
18
|
-
const repoNotFound = error.githubResponse.data.errors?.some((error) => error.type === 'NOT_FOUND' && error.path
|
|
18
|
+
const repoNotFound = error.githubResponse.data.errors?.some((error) => error.type === 'NOT_FOUND' && error.path?.join('.') === 'repository');
|
|
19
19
|
const grantedScopes = error.githubResponse.headers['x-oauth-scopes'] || '';
|
|
20
20
|
const requiredScopes = error.githubResponse.headers['x-accepted-oauth-scopes'] || '';
|
|
21
21
|
const ssoHeader = (0, maybe_1.maybe)(error.githubResponse.headers['x-github-sso']);
|
|
@@ -40,7 +40,7 @@ exports.parseRemoteConfig = parseRemoteConfig;
|
|
|
40
40
|
function swallowMissingConfigFileException(error) {
|
|
41
41
|
const { data, errors } = error.githubResponse.data;
|
|
42
42
|
const missingConfigError = errors?.some((error) => {
|
|
43
|
-
return error.path
|
|
43
|
+
return error.path?.includes('remoteConfig') && error.type === 'NOT_FOUND';
|
|
44
44
|
});
|
|
45
45
|
// swallow error if it's just the config file that's missing
|
|
46
46
|
if (missingConfigError && data != null) {
|
package/dist/ui/getCommits.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "7.3.
|
|
1
|
+
export declare const PACKAGE_VERSION = "7.3.6";
|