Skip to content

Instantly share code, notes, and snippets.

@rafayepes
Forked from rauschma/FsExtra.re
Created January 30, 2018 06:51
Show Gist options
  • Save rafayepes/c16a4570c676b6d7f7580401db0b8783 to your computer and use it in GitHub Desktop.
Save rafayepes/c16a4570c676b6d7f7580401db0b8783 to your computer and use it in GitHub Desktop.
type copyOpts;
[@bs.obj] external makeCopyOpts : (~overwrite: bool=?, ~errorOnExist: bool=?, ~dereference: bool=?, ~preserveTimestamps: bool=?, ~filter: (string=>bool)=?, unit) => copyOpts = "";
/* copySync(src, dest, [options]) */
/* https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy-sync.md */
[@bs.module "fs-extra"] external copySyncExternal : (string, string, copyOpts) => unit = "copySync";
let copySync = (~overwrite=?, ~errorOnExist=?, ~dereference=?, ~preserveTimestamps=?, ~filter:option(string => bool)=?,
src: string, dest: string) =>
copySyncExternal(src, dest,
makeCopyOpts(~overwrite?, ~errorOnExist?, ~dereference?, ~preserveTimestamps?, ~filter?, ()) );
copySync("SOURCE", "DESTINATION");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment