Compare commits
No commits in common. "5347c7185148a6a8b01e75d0747057767c4b59af" and "d68d397f660cc7e598c2c27f0b857d48082b1eee" have entirely different histories.
5347c71851
...
d68d397f66
|
@ -29,8 +29,5 @@ alias clipboard-to-file="xclip -sel clip -o > $1"
|
||||||
alias file-to-clipboard="xclip -sel clip -i $1"
|
alias file-to-clipboard="xclip -sel clip -i $1"
|
||||||
alias gpg-decrypt-clipboard="xclip -sel clip -o | gpg --decrypt"
|
alias gpg-decrypt-clipboard="xclip -sel clip -o | gpg --decrypt"
|
||||||
|
|
||||||
# Video aliases.
|
|
||||||
alias get-resolution="ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x"
|
|
||||||
|
|
||||||
# See '$BAUKE_DIR/Restic Backups.md' for information.
|
# See '$BAUKE_DIR/Restic Backups.md' for information.
|
||||||
alias restic-b2="source $BAUKE_DIR/data/restic-b2-credentials.zsh && restic"
|
alias restic-b2="source $BAUKE_DIR/data/restic-b2-credentials.zsh && restic"
|
||||||
|
|
|
@ -15,15 +15,10 @@ export const runCommand = new Command()
|
||||||
"--include-directories",
|
"--include-directories",
|
||||||
"Include directories found inside the directories.",
|
"Include directories found inside the directories.",
|
||||||
)
|
)
|
||||||
.option(
|
.action(async ({ directory, includeDirectories }) => {
|
||||||
"--output-script",
|
|
||||||
"Output the commands as a shell script instead of running them.",
|
|
||||||
)
|
|
||||||
.action(async ({ directory, includeDirectories, outputScript }) => {
|
|
||||||
await actionHandler({
|
await actionHandler({
|
||||||
directories: directory,
|
directories: directory,
|
||||||
includeDirectories: includeDirectories ?? false,
|
includeDirectories: includeDirectories ?? false,
|
||||||
outputScript: outputScript ?? false,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -31,7 +26,6 @@ async function actionHandler(
|
||||||
options: {
|
options: {
|
||||||
directories: string[];
|
directories: string[];
|
||||||
includeDirectories: boolean;
|
includeDirectories: boolean;
|
||||||
outputScript: boolean;
|
|
||||||
},
|
},
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
let command: string[] = [];
|
let command: string[] = [];
|
||||||
|
@ -141,22 +135,6 @@ async function actionHandler(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.outputScript) {
|
|
||||||
const defaultFilename = "bulk-run-script.zsh";
|
|
||||||
const { filename } = await prompt.prompt([
|
|
||||||
{
|
|
||||||
type: prompt.Input,
|
|
||||||
name: "filename",
|
|
||||||
message: "Filename for the script",
|
|
||||||
default: defaultFilename,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const commands = constructedCommands.map((c) => c.join(" ")).join("\n");
|
|
||||||
await Deno.writeTextFile(
|
|
||||||
filename ?? defaultFilename,
|
|
||||||
`#!/usr/bin/env zsh\n\n${commands}`,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
console.log("\n## Output");
|
console.log("\n## Output");
|
||||||
for (const constructedCommand of constructedCommands) {
|
for (const constructedCommand of constructedCommands) {
|
||||||
await Deno.run({
|
await Deno.run({
|
||||||
|
@ -164,5 +142,4 @@ async function actionHandler(
|
||||||
}).status();
|
}).status();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue