File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ function isInstallingNativeScriptGloballyWithNpm(): boolean {
7373 const isGlobalCommand = doesCurrentNpmCommandMatch ( [ / ^ - - g l o b a l $ / , / ^ - g $ / ] ) ;
7474 const hasNativeScriptPackage = doesCurrentNpmCommandMatch ( [
7575 / ^ 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 ? $ / ,
7677 ] ) ;
7778
7879 return isInstallCommand && isGlobalCommand && hasNativeScriptPackage ;
@@ -84,6 +85,7 @@ function isInstallingNativeScriptGloballyWithYarn(): boolean {
8485 const isGlobalCommand = doesCurrentNpmCommandMatch ( [ / ^ g l o b a l $ / ] ) ;
8586 const hasNativeScriptPackage = doesCurrentNpmCommandMatch ( [
8687 / ^ 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 ? $ / ,
8789 ] ) ;
8890
8991 return isInstallCommand && isGlobalCommand && hasNativeScriptPackage ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as _ from "lodash";
33import { IErrors , IFileSystem , IProjectHelper } from "./declarations" ;
44import { IOptions } from "../declarations" ;
55import { injector } from "./yok" ;
6+ import { SCOPED_TNS_CORE_MODULES , TNS_CORE_MODULES_NAME } from "../constants" ;
67
78export class ProjectHelper implements IProjectHelper {
89 constructor (
@@ -75,7 +76,10 @@ export class ProjectHelper implements IProjectHelper {
7576 private isProjectFileCorrect ( projectFilePath : string ) : boolean {
7677 try {
7778 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+ ) ;
7983 } catch ( err ) {
8084 this . $errors . fail (
8185 "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 {
245245
246246 const packageJsonData = {
247247 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
249249 version : "0.1.0" ,
250250 devDependencies : {
251251 "tns-android" : "1.4.0" ,
You can’t perform that action at this time.
0 commit comments