Skip to content

Commit

Permalink
fixes #938, check install-modules (#941)
Browse files Browse the repository at this point in the history
check `install-modules` even if `install-modules-with` is missing.
  • Loading branch information
shogo82148 committed Dec 12, 2021
1 parent b42ab90 commit fc967a8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/cpan-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ export interface Options {
}

export async function install(opt: Options): Promise<void> {
if (!opt.install_modules_with) {
core.info("nothing to install");
return;
}
let installer: (opt: Options) => Promise<void>;
switch (opt.install_modules_with) {
switch (opt.install_modules_with || "cpanm") {
case "cpanm":
installer = installWithCpanm;
break;
Expand Down Expand Up @@ -162,8 +158,10 @@ async function installWithCpanm(opt: Options): Promise<void> {
args.push("--verbose");
}
args.push(...splitArgs(opt.install_modules_args));
if (await exists(path.join(workingDirectory, "cpanfile"))) {
await exec.exec(perl, [...args, "--installdeps", "."], execOpt);
if (opt.install_modules_with) {
if (await exists(path.join(workingDirectory, "cpanfile"))) {
await exec.exec(perl, [...args, "--installdeps", "."], execOpt);
}
}
const modules = splitModules(opt.install_modules);
if (modules.length > 0) {
Expand Down

0 comments on commit fc967a8

Please sign in to comment.