Skip to content

Commit

Permalink
feat(fs): add pathReadable, pathWritable, and pathExecutable
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd committed Mar 3, 2019
1 parent eb14e8d commit 5412791
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/@ionic/utils-fs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ export async function pathExists(filePath: string): Promise<boolean> {
return pathAccessible(filePath, fs.constants.F_OK);
}

export async function pathReadable(filePath: string): Promise<boolean> {
return pathAccessible(filePath, fs.constants.R_OK);
}

export async function pathWritable(filePath: string): Promise<boolean> {
return pathAccessible(filePath, fs.constants.W_OK);
}

export async function pathExecutable(filePath: string): Promise<boolean> {
return pathAccessible(filePath, fs.constants.X_OK);
}

/**
* Find the base directory based on the path given and a marker file to look for.
*/
Expand Down

0 comments on commit 5412791

Please sign in to comment.