Download src/utils.ts from yamxxx1/backdd: direct link, hf CLI and curl.
- Browser
- Download file 521 Bytes
-
https://huggingface.co/spaces/yamxxx1/backdd/resolve/main/src/utils.ts
- Command line
-
hf download hf://spaces/yamxxx1/backdd/src/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/yamxxx1/backdd/resolve/main/src/utils.ts
521 Bytes
| import {execSync, ExecSyncOptions} from 'child_process' | |
| import {als} from './context' | |
| /** | |
| * Executes a shell command using the current context's working directory. | |
| * Thread-safe for Probot. | |
| */ | |
| export const prixExec = ( | |
| command: string, | |
| options: ExecSyncOptions = {} | |
| ): string => { | |
| const context = als.getStore() | |
| const cwd = options.cwd || context?.workingDir || process.cwd() | |
| const result = execSync(command, { | |
| ...options, | |
| cwd, | |
| encoding: 'utf8' | |
| }) | |
| return result ? result.toString() : '' | |
| } | |