Skip to content

Commit 0157f2e

Browse files
Merge pull request #641 from NativeScript/vladimirov/fix-values-dir
Do not delete values dirs
2 parents 373c6bb + bcba5fb commit 0157f2e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/services/android-project-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ class AndroidProjectService implements IPlatformProjectService {
185185
public prepareAppResources(appResourcesDirectoryPath: string): IFuture<void> {
186186
return (() => {
187187
let resourcesDirPath = path.join(appResourcesDirectoryPath, this.platformData.normalizedPlatformName);
188-
let resourcesDirs = this.$fs.readDirectory(resourcesDirPath).wait();
188+
let valuesDirRegExp = /^values/;
189+
let resourcesDirs = this.$fs.readDirectory(resourcesDirPath).wait().filter(resDir => !resDir.match(valuesDirRegExp));
189190
_.each(resourcesDirs, resourceDir => {
190-
this.$fs.deleteDirectory(path.join(this.platformData.appResourcesDestinationDirectoryPath, resourceDir)).wait();
191+
this.$fs.deleteDirectory(path.join(this.platformData.appResourcesDestinationDirectoryPath, resourceDir)).wait();
191192
});
192193
}).future<void>()();
193194
}

lib/services/platform-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class PlatformService implements IPlatformService {
173173
var appResourcesDirectoryPath = path.join(appDestinationDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME);
174174
if (this.$fs.exists(appResourcesDirectoryPath).wait()) {
175175
platformData.platformProjectService.prepareAppResources(appResourcesDirectoryPath).wait();
176-
shell.cp("-R", path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName, "*"), platformData.appResourcesDestinationDirectoryPath);
176+
shell.cp("-Rf", path.join(appResourcesDirectoryPath, platformData.normalizedPlatformName, "*"), platformData.appResourcesDestinationDirectoryPath);
177177
this.$fs.deleteDirectory(appResourcesDirectoryPath).wait();
178178
}
179179

0 commit comments

Comments
 (0)