Skip to content

Commit

Permalink
reverted split
Browse files Browse the repository at this point in the history
  • Loading branch information
mbruno-kr committed Mar 24, 2023
1 parent 6179253 commit 7a6eadc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
11 changes: 2 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ const os_1 = __nccwpck_require__(2037);
const path = __importStar(__nccwpck_require__(1017));
const CACHE_PATH = [path.join((0, os_1.homedir)(), ".rustup", "toolchains")];
const INSTALL_ARGS = ["--default-toolchain", "none", "-y"];
function splitArg(arg) {
return arg
.split(",")
.map(e => e.split(" "))
.flat()
.filter(e => e.length > 0);
}
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
Expand Down Expand Up @@ -94,13 +87,13 @@ function run() {
"--allow-downgrade",
];
if (components) {
splitArg(components).forEach(val => {
components.split(" ").forEach(val => {
args.push("--component");
args.push(val);
});
}
if (targets) {
splitArg(targets).forEach(val => {
targets.split(" ").forEach(val => {
args.push("--target");
args.push(val);
});
Expand Down
12 changes: 2 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import * as path from "path";
const CACHE_PATH = [path.join(homedir(), ".rustup", "toolchains")];
const INSTALL_ARGS = ["--default-toolchain", "none", "-y"];

function splitArg(arg: string): string[] {
return arg
.split(",")
.map(e => e.split(" "))
.flat()
.filter(e => e.length > 0);
}

async function run(): Promise<void> {
try {
try {
Expand Down Expand Up @@ -62,13 +54,13 @@ async function run(): Promise<void> {
"--allow-downgrade",
];
if (components) {
splitArg(components).forEach(val => {
components.split(" ").forEach(val => {
args.push("--component");
args.push(val);
});
}
if (targets) {
splitArg(targets).forEach(val => {
targets.split(" ").forEach(val => {
args.push("--target");
args.push(val);
});
Expand Down

0 comments on commit 7a6eadc

Please sign in to comment.