Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Last active November 5, 2025 13:33
Show Gist options
  • Select an option

  • Save sogaiu/167262122b654414c586ad4302d3a849 to your computer and use it in GitHub Desktop.

Select an option

Save sogaiu/167262122b654414c586ad4302d3a849 to your computer and use it in GitHub Desktop.

suppose cloned content is:

my-dir/a.janet
my-dir/b.janet
my-dir/my-subdir/c.janet

assuming trailing "/" means something is a directory...

what should the following mean?

{:src "my-dir/"
 :dest "another-dir/"}
another-dir/a.janet
another-dir/b.janet
another-dir/my-subdir/c.janet
another-dir/my-dir/a.janet
another-dir/my-dir/b.janet
another-dir/my-dir/my-subdir/c.janet

for reference, cp's behavior is more like case 2 when invoked like:

$ cp -a my-dir/ another-dir/

to get a case like case 1, cp can be used like:

$ cp -a my-dir/* another-dir/

which might be seen as short-hand for:

$ cp my-dir/a.janet another-dir/
$ cp my-dir/b.janet another-dir/
$ mkdir another-dir/my-subdir
$ cp my-dir/my-subdir/c.janet another-dir/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment