Correctly validate gomodpath (#19)
* Correctly validate go mod path * add a reasonable default * preserve required expectation instead * regenerate the JS
This commit is contained in:
Vendored
+2
-2
@@ -50,8 +50,8 @@ const dependency_submission_toolkit_1 = __nccwpck_require__(9810);
|
|||||||
const process_1 = __nccwpck_require__(4077);
|
const process_1 = __nccwpck_require__(4077);
|
||||||
function main() {
|
function main() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const goModPath = path_1.default.normalize(core.getInput('go-mod-path'));
|
const goModPath = path_1.default.normalize(core.getInput('go-mod-path', { required: true }));
|
||||||
if (path_1.default.basename(goModPath) !== 'go.mod' && fs_1.default.existsSync(goModPath)) {
|
if (path_1.default.basename(goModPath) !== 'go.mod' || !fs_1.default.existsSync(goModPath)) {
|
||||||
throw new Error(`${goModPath} is not a go.mod file or does not exist!`);
|
throw new Error(`${goModPath} is not a go.mod file or does not exist!`);
|
||||||
}
|
}
|
||||||
const goModDir = path_1.default.dirname(goModPath);
|
const goModDir = path_1.default.dirname(goModPath);
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+4
-2
@@ -16,9 +16,11 @@ import {
|
|||||||
} from './process'
|
} from './process'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const goModPath = path.normalize(core.getInput('go-mod-path'))
|
const goModPath = path.normalize(
|
||||||
|
core.getInput('go-mod-path', { required: true })
|
||||||
|
)
|
||||||
|
|
||||||
if (path.basename(goModPath) !== 'go.mod' && fs.existsSync(goModPath)) {
|
if (path.basename(goModPath) !== 'go.mod' || !fs.existsSync(goModPath)) {
|
||||||
throw new Error(`${goModPath} is not a go.mod file or does not exist!`)
|
throw new Error(`${goModPath} is not a go.mod file or does not exist!`)
|
||||||
}
|
}
|
||||||
const goModDir = path.dirname(goModPath)
|
const goModDir = path.dirname(goModPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user