Skip to content

Commit

Permalink
build v1.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed May 21, 2021
1 parent 1196426 commit 9197643
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ async function installWithCpanm(opt) {
if (await exists(path.join(workingDirectory, 'cpanfile'))) {
await exec.exec(perl, [...args, '--installdeps', '.'], execOpt);
}
if (opt.install_modules) {
const modules = opt.install_modules.split('\n').map(s => s.trim());
const modules = splitModules(opt.install_modules);
if (modules.length > 0) {
await exec.exec(perl, [...args, ...modules], execOpt);
}
}
Expand All @@ -201,8 +201,8 @@ async function installWithCpm(opt) {
(await exists(path.join(workingDirectory, 'cpanfile.snapshot')))) {
await exec.exec(perl, [...args], execOpt);
}
if (opt.install_modules) {
const modules = opt.install_modules.split('\n').map(s => s.trim());
const modules = splitModules(opt.install_modules);
if (modules.length > 0) {
await exec.exec(perl, [...args, ...modules], execOpt);
}
}
Expand All @@ -219,9 +219,9 @@ async function installWithCarton(opt) {
(await exists(path.join(workingDirectory, 'cpanfile.snapshot')))) {
await exec.exec(perl, [...args], execOpt);
}
if (opt.install_modules) {
const modules = splitModules(opt.install_modules);
if (modules.length > 0) {
const cpanm = path.join(__dirname, '..', 'bin', 'cpanm');
const modules = opt.install_modules.split('\n').map(s => s.trim());
const args = [cpanm, '--local-lib-contained', 'local', '--notest'];
if (core.isDebug()) {
args.push('--verbose');
Expand Down Expand Up @@ -255,6 +255,16 @@ function splitArgs(args) {
}
return args.split(/\s+/);
}
function splitModules(modules) {
if (!modules) {
return [];
}
modules = modules.trim();
if (modules === '') {
return [];
}
return modules.split(/\s+/);
}


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 9197643

Please sign in to comment.