File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
build-artifacts/project-template-gradle/src/main/java/com/tns
test-app/app/src/main/java/com/tns Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,11 @@ public void run() {
128
128
int length = input .readInt ();
129
129
input .readFully (new byte [length ]); // ignore the payload
130
130
executePartialSync (context , syncDir );
131
+ // delete temporary /sync dir after syncing .xml/.css resources
132
+ deleteRecursive (syncDir );
131
133
executeRemovedSync (context , removedSyncDir );
134
+ // delete temporary /removedsync dir after removing files from the project
135
+ deleteRecursive (removedSyncDir );
132
136
133
137
runtime .runScript (new File (NativeScriptSyncService .this .context .getFilesDir (), "internal/livesync.js" ));
134
138
try {
@@ -157,7 +161,11 @@ private void deleteRecursive(File fileOrDirectory) {
157
161
}
158
162
}
159
163
160
- fileOrDirectory .delete ();
164
+ boolean success = fileOrDirectory .delete ();
165
+
166
+ if (!success && fileOrDirectory .isDirectory ()) {
167
+ android .util .Log .d ("Sync" , "Failed to delete temp sync directory: " + fileOrDirectory .getAbsolutePath ());
168
+ }
161
169
}
162
170
163
171
public static boolean isSyncEnabled (Context context ) {
Original file line number Diff line number Diff line change @@ -128,7 +128,11 @@ public void run() {
128
128
int length = input .readInt ();
129
129
input .readFully (new byte [length ]); // ignore the payload
130
130
executePartialSync (context , syncDir );
131
+ // delete temporary /sync dir after syncing .xml/.css resources
132
+ deleteRecursive (syncDir );
131
133
executeRemovedSync (context , removedSyncDir );
134
+ // delete temporary /removedsync dir after removing files from the project
135
+ deleteRecursive (removedSyncDir );
132
136
133
137
runtime .runScript (new File (NativeScriptSyncService .this .context .getFilesDir (), "internal/livesync.js" ));
134
138
try {
@@ -157,7 +161,11 @@ private void deleteRecursive(File fileOrDirectory) {
157
161
}
158
162
}
159
163
160
- fileOrDirectory .delete ();
164
+ boolean success = fileOrDirectory .delete ();
165
+
166
+ if (!success && fileOrDirectory .isDirectory ()) {
167
+ android .util .Log .d ("Sync" , "Failed to delete temp sync directory: " + fileOrDirectory .getAbsolutePath ());
168
+ }
161
169
}
162
170
163
171
public static boolean isSyncEnabled (Context context ) {
You can’t perform that action at this time.
0 commit comments