Skip to content

Instantly share code, notes, and snippets.

@victorvoid
Created August 9, 2018 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorvoid/c4199695af5eb26357023f74b27508f9 to your computer and use it in GitHub Desktop.
Save victorvoid/c4199695af5eb26357023f74b27508f9 to your computer and use it in GitHub Desktop.
function Add(directory, dirWhereSaved){
return fromNullable(directory)
.map(() =>
exist(directory)
.and(createATemplate(directory, dirWhereSaved))
.and(cp(directory)))
.getOrElse(rejected(`You need to pass the path as a parameter`))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment