Skip to content

Commit d22ad0d

Browse files
Merge pull request #3801 from NativeScript/kddimitrov/bump-vresion-4.2.1
chore: bump version to 4.2.1
2 parents 6c230ab + 60ee551 commit d22ad0d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

lib/services/project-service.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as shelljs from "shelljs";
44
import { format } from "util";
55
import { exported } from "../common/decorators";
66
import { Hooks, TemplatesV2PackageJsonKeysToRemove } from "../constants";
7+
import * as temp from "temp";
78

89
export class ProjectService implements IProjectService {
910

@@ -131,14 +132,16 @@ export class ProjectService implements IProjectService {
131132

132133
private async ensureAppResourcesExist(projectDir: string): Promise<void> {
133134
const projectData = this.$projectDataService.getProjectData(projectDir);
134-
const appPath = projectData.getAppDirectoryPath(projectDir);
135135
const appResourcesDestinationPath = projectData.getAppResourcesDirectoryPath(projectDir);
136136

137137
if (!this.$fs.exists(appResourcesDestinationPath)) {
138138
this.$fs.createDirectory(appResourcesDestinationPath);
139-
139+
const tempDir = temp.mkdirSync("ns-default-template");
140140
// the template installed doesn't have App_Resources -> get from a default template
141-
await this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], appPath, { filter: (name: string, entry: any) => entry.path.indexOf(constants.APP_RESOURCES_FOLDER_NAME) !== -1 });
141+
await this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], tempDir);
142+
const templateProjectData = this.$projectDataService.getProjectData(tempDir);
143+
const templateAppResourcesDir = templateProjectData.getAppResourcesDirectoryPath(tempDir);
144+
this.$fs.copyFile(path.join(templateAppResourcesDir, "*"), appResourcesDestinationPath);
142145
}
143146
}
144147

npm-shrinkwrap.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "4.2.0",
4+
"version": "4.2.1",
55
"author": "Telerik <[email protected]>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {

0 commit comments

Comments
 (0)