@@ -2,8 +2,8 @@ import joplin from "api";
22import * as path from "path" ;
33import { exec } from "child_process" ;
44import { promisify } from "util" ;
5- import { copyFileSync } from "fs-extra" ;
6- import { moveSync } from "fs-extra" ;
5+ import { copyFileSync } from "fs-extra" ;
6+ import { moveSync } from "fs-extra" ;
77
88export namespace helper {
99 export async function validFileName ( fileName : string ) {
@@ -97,20 +97,29 @@ export namespace helper {
9797
9898 // Workaround for "ENOTSUP: operation not supported on socket" #98
9999 // https://github.com/JackGruber/joplin-plugin-backup/issues/98
100- export async function WorkaroundCopyFile ( src : string , dst : string , fsWorkaroundLinux : boolean ) : Promise < boolean > {
100+ export async function WorkaroundCopyFile (
101+ src : string ,
102+ dst : string ,
103+ fsWorkaroundLinux : boolean
104+ ) : Promise < boolean > {
101105 if ( process . platform == "linux" && fsWorkaroundLinux === true ) {
102106 var execPromise = promisify ( exec ) ;
103- await execPromise ( `cp '${ src } ' '${ dst } '` ) ;
107+ await execPromise ( `cp -r '${ src } ' '${ dst } '` ) ;
104108 } else {
105109 copyFileSync ( src , dst ) ;
106110 }
107111
108- return true
112+ return true ;
109113 }
110114
111115 // Workaround for "ENOTSUP: operation not supported on socket" #98
112116 // https://github.com/JackGruber/joplin-plugin-backup/issues/98
113- export async function WorkaroundMove ( src : string , dst : string , fsWorkaroundLinux : boolean , overwrite : boolean = false ) : Promise < boolean > {
117+ export async function WorkaroundMove (
118+ src : string ,
119+ dst : string ,
120+ fsWorkaroundLinux : boolean ,
121+ overwrite : boolean = false
122+ ) : Promise < boolean > {
114123 if ( process . platform == "linux" && fsWorkaroundLinux === true ) {
115124 var execPromise = promisify ( exec ) ;
116125 await execPromise ( `mv '${ src } ' '${ dst } '` ) ;
@@ -120,6 +129,6 @@ export namespace helper {
120129 } ) ;
121130 }
122131
123- return true
132+ return true ;
124133 }
125134}
0 commit comments