File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ function isInstallingNativeScriptGloballyWithNpm(): boolean {
73
73
const isGlobalCommand = doesCurrentNpmCommandMatch ( [ / ^ - - g l o b a l $ / , / ^ - g $ / ] ) ;
74
74
const hasNativeScriptPackage = doesCurrentNpmCommandMatch ( [
75
75
/ ^ n a t i v e s c r i p t ( @ .* ) ? $ / ,
76
+ / n a t i v e s c r i p t - ( .* ) \. t g z ? $ / ,
76
77
] ) ;
77
78
78
79
return isInstallCommand && isGlobalCommand && hasNativeScriptPackage ;
@@ -84,6 +85,7 @@ function isInstallingNativeScriptGloballyWithYarn(): boolean {
84
85
const isGlobalCommand = doesCurrentNpmCommandMatch ( [ / ^ g l o b a l $ / ] ) ;
85
86
const hasNativeScriptPackage = doesCurrentNpmCommandMatch ( [
86
87
/ ^ n a t i v e s c r i p t ( @ .* ) ? $ / ,
88
+ / n a t i v e s c r i p t - ( .* ) \. t g z ? $ / ,
87
89
] ) ;
88
90
89
91
return isInstallCommand && isGlobalCommand && hasNativeScriptPackage ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as _ from "lodash";
3
3
import { IErrors , IFileSystem , IProjectHelper } from "./declarations" ;
4
4
import { IOptions } from "../declarations" ;
5
5
import { injector } from "./yok" ;
6
+ import { SCOPED_TNS_CORE_MODULES , TNS_CORE_MODULES_NAME } from "../constants" ;
6
7
7
8
export class ProjectHelper implements IProjectHelper {
8
9
constructor (
@@ -75,7 +76,10 @@ export class ProjectHelper implements IProjectHelper {
75
76
private isProjectFileCorrect ( projectFilePath : string ) : boolean {
76
77
try {
77
78
const fileContent = this . $fs . readText ( projectFilePath ) ;
78
- return fileContent . includes ( "nativescript" ) ;
79
+ return (
80
+ fileContent . includes ( SCOPED_TNS_CORE_MODULES ) ||
81
+ fileContent . includes ( TNS_CORE_MODULES_NAME )
82
+ ) ;
79
83
} catch ( err ) {
80
84
this . $errors . fail (
81
85
"The project file is corrupted. Additional technical information: %s" ,
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ function createProjectFile(testInjector: IInjector): string {
245
245
246
246
const packageJsonData = {
247
247
name : "testModuleName" ,
248
- description : "nativescript" , // important for project file checks - currently just looking for the nativescript keyword
248
+ description : "@ nativescript/core " , // important for project file checks - currently just looking for the @ nativescript/core keyword
249
249
version : "0.1.0" ,
250
250
devDependencies : {
251
251
"tns-android" : "1.4.0" ,
You can’t perform that action at this time.
0 commit comments