Skip to content

Commit

Permalink
Merge branch 'master' into add-test-stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
arapower committed May 28, 2024
2 parents 66f2552 + ded67b3 commit 60da091
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/std/main.ab
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ pub fun replace_regex(source: Text, pattern: Text, replacement: Text): Text {
return unsafe $echo "{source}" | sed -e "s/{pattern}/{replacement}/g"$
}

pub fun dir_exist(path) {
$[ -d "{path}" ]$ failed {
return false
}
return true
}

pub fun file_exist(path) {
$[ -f "{path}" ]$ failed {
return false
}
return true
}

pub fun file_read(path) {
return $cat "{path}"$?
}
Expand Down

0 comments on commit 60da091

Please sign in to comment.