copyDir copies all sub-directories to root folder - Windows 10 Platform

#1

I have few files in sub-folders inside a main folder “docs”. When i use file plugin’s copyDir() to move it to a new location, all sub-folders get copied outside the new directory. How to fix this?

My code: this.g.file.copyDir(this.g.file.applicationDirectory+‘www/assets/’, ‘docs’, this.g.file.dataDirectory, ‘docs’)

Original folder structure:

docs/

  • sub1/file
  • sub2/file
  • sub3/file

After copyDir, the sub-directories are in the same level as the main directory :frowning:

docs/
sub1/file
sub2/file
sub3/file

Ionic:

ionic (Ionic CLI) : 4.1.0 (C:\Users\cjsuthanthira\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 5 other plugins)

System:

NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10

My file plugin version is 6.0.1