mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
add runLocally, add required opt for Option
This commit is contained in:
parent
b4f8cd894f
commit
76bd1ad784
1 changed files with 13 additions and 4 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import { ParsedArgs } from './parsing.ts';
|
||||
import { getOptionName, ParsedArgs } from './parsing.ts';
|
||||
import { Command } from './command.ts';
|
||||
import { defaultIdentityFile } from './ssh/identity.ts';
|
||||
import { connect } from './ssh/mod.ts';
|
||||
import { makeSshAction, privkeyToPubkey } from './ssh/mod.ts';
|
||||
|
||||
export type Option =
|
||||
& { description: string }
|
||||
& { description: string; required?: true }
|
||||
& ({
|
||||
default?: string;
|
||||
} | {
|
||||
|
|
@ -16,5 +16,14 @@ export const cleanArg = (arg: string) => {
|
|||
return arg.replace(/^--?/g, '');
|
||||
};
|
||||
|
||||
export { Command, connect, defaultIdentityFile };
|
||||
export async function runLocally(cmd: string) {
|
||||
console.log(cmd);
|
||||
const command = new Deno.Command('bash', {
|
||||
args: ['-c', cmd],
|
||||
});
|
||||
|
||||
return command.output();
|
||||
}
|
||||
|
||||
export { Command, defaultIdentityFile, getOptionName, makeSshAction, privkeyToPubkey };
|
||||
export type { ParsedArgs };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue