forked from actions/toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add io lib * io cleanup * Run format script * Fix lint errors with autofix * Fix equality lint errors * Rename ioUtil to io-util * Add no-import-requires * Run auto-fix lint * Remove lint errors * Use Boolean() to convert options - `CopyOptions` on `cp` now defaults to empty - Setting option values is easier now * Rewrite packages/io to be fully async * Move IS_WINDOWS into ioUtil * DRY up cp/mv by moving shared code into move function * Remove unc support, change isDirectory call to stat * Tighter try catches * more concise extensions search * Allow isDirectory to be stat or lstat * format * Shell out to rm -rf * Remove unc comment * Export fs.promises from io-util * Remove unknown error message * Create an optimistic mkdirp * Update io-util.ts * Update io-util.ts * Update io.test.ts * Fix tests for mkdirP
- Loading branch information
Danny McCormick
authored
May 22, 2019
1 parent
4f5f4f2
commit 08db511
Showing
8 changed files
with
2,059 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
packages/*/node_modules/ | ||
packages/*/lib/ | ||
packages/*/lib/ | ||
packages/*/__tests__/_temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# `@actions/io` | ||
|
||
> Core functions for cli filesystem scenarios | ||
## Usage | ||
|
||
``` | ||
/** | ||
* Copies a file or folder. | ||
* | ||
* @param source source path | ||
* @param dest destination path | ||
* @param options optional. See CopyOptions. | ||
*/ | ||
export function cp(source: string, dest: string, options?: CopyOptions): Promise<void> | ||
/** | ||
* Remove a path recursively with force | ||
* | ||
* @param path path to remove | ||
*/ | ||
export function rmRF(path: string): Promise<void> | ||
/** | ||
* Make a directory. Creates the full path with folders in between | ||
* | ||
* @param p path to create | ||
* @returns Promise<void> | ||
*/ | ||
export function mkdirP(p: string): Promise<void> | ||
/** | ||
* Moves a path. | ||
* | ||
* @param source source path | ||
* @param dest destination path | ||
* @param options optional. See CopyOptions. | ||
*/ | ||
export function mv(source: string, dest: string, options?: CopyOptions): Promise<void> | ||
/** | ||
* Returns path of a tool had the tool actually been invoked. Resolves via paths. | ||
* | ||
* @param tool name of the tool | ||
* @param options optional. See WhichOptions. | ||
* @returns Promise<string> path to tool | ||
*/ | ||
export function which(tool: string, options?: WhichOptions): Promise<string> | ||
``` |
Oops, something went wrong.