Skip to content

Commit 6e50201

Browse files
committed
solved issue #19: geminio command throwing EISDIR error when source is file and destination is directory
1 parent 40cd5e4 commit 6e50201

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

geminio.js

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ else{
1212
var destination = process.argv[3];
1313

1414
if(fs.existsSync(source)){
15+
const srcStats = fs.statSync(source);
16+
const destStats = fs.statSync(destination);
17+
18+
if (srcStats.isFile() && destStats.isDirectory()){
19+
const temp = source.split('/');
20+
destination += '/' + temp[temp.length - 1];
21+
}
22+
1523
fs.copy(source,destination,err => {
1624
if(err){
1725
return console.log(err);

0 commit comments

Comments
 (0)