mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
saneSplit -> nonEmptySplit
This commit is contained in:
parent
cea7883cb2
commit
34a3c66a7e
5 changed files with 21 additions and 21 deletions
|
|
@ -50,11 +50,11 @@ function run() {
|
|||
},
|
||||
}
|
||||
};
|
||||
const args = strings_1.extrasperse('-A', strings_1.saneSplit(attributes, /\s/)).concat([file || "default.nix"]);
|
||||
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s/)).concat([file || "default.nix"]);
|
||||
yield exec.exec('nix-build', args, options);
|
||||
core.endGroup();
|
||||
core.startGroup(`Cachix: pushing to ` + push);
|
||||
yield exec.exec('cachix', ['push', push].concat(strings_1.saneSplit(paths, /\s/).join(' ')));
|
||||
yield exec.exec('cachix', ['push', push].concat(strings_1.nonEmptySplit(paths, /\s/).join(' ')));
|
||||
core.endGroup();
|
||||
}
|
||||
catch (error) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function extrasperse(elem, array) {
|
||||
function prependEach(elem, array) {
|
||||
const init = [];
|
||||
return array.reduce((r, a) => r.concat(elem, a), init);
|
||||
}
|
||||
exports.extrasperse = extrasperse;
|
||||
exports.prependEach = prependEach;
|
||||
;
|
||||
function saneSplit(str, separator) {
|
||||
function nonEmptySplit(str, separator) {
|
||||
return str.split(separator).filter(word => word != "");
|
||||
}
|
||||
exports.saneSplit = saneSplit;
|
||||
exports.nonEmptySplit = nonEmptySplit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue