Skip to content

Commit

Permalink
Merge pull request #17 from BrianCArnold/master
Browse files Browse the repository at this point in the history
Get rid of setting output variable to perl script / logging info
  • Loading branch information
atoomic authored Jan 2, 2024
2 parents 559644e + 798bfcd commit 70a9c9d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ async function install_cpm(install_to) {
const version = core.getInput("version");
const url = `https://raw.githubusercontent.com/skaji/cpm/${version}/cpm`;

core.setOutput(`Get cpm from ${url}`);
core.info(`Get cpm from ${url}`);

const cpmScript = await tc.downloadTool(url);

core.setOutput("cpm", cpmScript);
core.info("cpm", cpmScript);

console.log(`install_to ${install_to}`);
core.info(`install_to ${install_to}`);

const platform = os.platform();
//console.log(`OS: :${platform}:`);
//core.info(`OS: :${platform}:`);

if (platform == "win32") {
await io.cp(cpmScript, install_to);
Expand Down Expand Up @@ -83,7 +83,7 @@ async function do_exec(cmd) {
const platform = os.platform();
const bin = sudo && platform != "win32" ? "sudo" : cmd.shift();

console.log(`do_exec: ${bin}`);
core.info(`do_exec: ${bin}`);

await exec.exec(bin, cmd);
}
Expand Down Expand Up @@ -134,7 +134,7 @@ async function run() {
/* install one ore more modules */
if (install !== null && install.length) {
// install one or more modules
console.log(`install: ${install}!`);
core.info(`install: ${install}!`);
const list = install.split("\n");

var cmd = [...CMD_install]; /* clone array */
Expand All @@ -147,9 +147,9 @@ async function run() {
/* install from cpanfile */
if (cpanfile !== null && cpanfile.length) {
// install one or more modules
console.log(`cpanfile: ${cpanfile}!`);
core.info(`cpanfile: ${cpanfile}!`);
const cpanfile_full_path = path.resolve(cpanfile);
console.log(`cpanfile: ${cpanfile_full_path}! [resolved]`);
core.info(`cpanfile: ${cpanfile_full_path}! [resolved]`);

var cmd = [...CMD_install];
cmd.push("--cpanfile", cpanfile_full_path);
Expand All @@ -160,7 +160,7 @@ async function run() {

/* custom run with args */
if ( has_run === false && w_args.length ) {
console.log(`custom run with args`);
core.info(`custom run with args`);
var cmd = [...CMD_install];
has_run = true;
await do_exec(cmd);
Expand Down

0 comments on commit 70a9c9d

Please sign in to comment.