Skip to content

Commit 6cebe57

Browse files
committed
manually create directories before copying files
1 parent 857e63c commit 6cebe57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

desktop-app/src/app/adb-client.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u
855855
let obbBackupPath = this.appService.path.join(this.appService.backupPath, packageName, 'data', folderName, 'obb');
856856
if (this.appService.fs.existsSync(obbBackupPath)) {
857857
this.appService.fs.readdir(obbBackupPath, async (err, entries) => {
858+
await this.runAdbCommand('adb shell mkdir -p /sdcard/Android/obb/' + packageName, true);
858859
for (let i = 0; i < entries.length; i++) {
859860
await this.adbCommand(
860861
'push',
@@ -1098,7 +1099,10 @@ This can sometimes be caused by changes to your hosts file. Don't make changes u
10981099
if (task) {
10991100
task.status = name + ': Transferring...';
11001101
}
1101-
let p: any = this.runAdbCommand('adb push "' + filepath + '" /sdcard/Android/obb/' + packageId + '/' + filename, true);
1102+
const obbDirectory: string = '/sdcard/Android/obb/' + packageId;
1103+
let p: any = this.runAdbCommand('adb shell mkdir -p ' + obbDirectory, true).then(() =>
1104+
this.runAdbCommand('adb push "' + filepath + '" ' + obbDirectory + '/' + filename, true)
1105+
);
11021106
if (cb) {
11031107
cb();
11041108
}

0 commit comments

Comments
 (0)