From d4552226923c9cb930722dd1738eca439ae79204 Mon Sep 17 00:00:00 2001 From: endarova Date: Mon, 18 Nov 2019 16:51:26 +0200 Subject: [PATCH 1/4] fix path on win --- products/nativescript/app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/products/nativescript/app.py b/products/nativescript/app.py index 2c7a3bbc..a29cedb4 100644 --- a/products/nativescript/app.py +++ b/products/nativescript/app.py @@ -2,10 +2,11 @@ import os from core.settings import Settings -from core.utils.file_utils import Folder +from core.utils.file_utils import Folder, File from core.utils.json_utils import JsonUtils from core.utils.npm import Npm from core.utils.run import run +from core.enums.os_type import OSType class App(object): @@ -84,3 +85,8 @@ def update(app_name, modules=True, angular=True, typescript=False, web_pack=True if vue and App.is_dependency(app_name=app_name, dependency='nativescript-vue'): Npm.uninstall(package='nativescript-vue', option='--save', folder=app_path) Npm.install(package='nativescript-vue@next', option='--save --save-exact', folder=app_path) + # on win when `npm i` is executed with path to .tgz it saves in package.json unix style path + # which cannot be resolved on win + if Settings.HOST_OS == OSType.WINDOWS: + packageJson = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json') + File.replace(packageJson, 'file://', 'file:\\\\') From 258be6606cd67d834bf2e3691f41210afbdbaa53 Mon Sep 17 00:00:00 2001 From: endarova Date: Tue, 19 Nov 2019 09:47:07 +0200 Subject: [PATCH 2/4] fix paths on windows --- products/nativescript/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/nativescript/app.py b/products/nativescript/app.py index a29cedb4..b4e527d1 100644 --- a/products/nativescript/app.py +++ b/products/nativescript/app.py @@ -88,5 +88,5 @@ def update(app_name, modules=True, angular=True, typescript=False, web_pack=True # on win when `npm i` is executed with path to .tgz it saves in package.json unix style path # which cannot be resolved on win if Settings.HOST_OS == OSType.WINDOWS: - packageJson = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json') - File.replace(packageJson, 'file://', 'file:\\\\') + packageJson = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json') + File.replace(packageJson, 'file://', '\\\\\\\\') From 9b4e4a7664224da86153d592222defde315633de Mon Sep 17 00:00:00 2001 From: endarova Date: Tue, 19 Nov 2019 10:21:49 +0200 Subject: [PATCH 3/4] update variable name --- products/nativescript/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/nativescript/app.py b/products/nativescript/app.py index b4e527d1..5ae7dd8d 100644 --- a/products/nativescript/app.py +++ b/products/nativescript/app.py @@ -88,5 +88,5 @@ def update(app_name, modules=True, angular=True, typescript=False, web_pack=True # on win when `npm i` is executed with path to .tgz it saves in package.json unix style path # which cannot be resolved on win if Settings.HOST_OS == OSType.WINDOWS: - packageJson = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json') - File.replace(packageJson, 'file://', '\\\\\\\\') + package_json = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json') + File.replace(package_json, 'file://', '\\\\\\\\') From dd79883141fe7722769804032dd70fd9bdd8d2f3 Mon Sep 17 00:00:00 2001 From: endarova Date: Tue, 19 Nov 2019 13:46:06 +0200 Subject: [PATCH 4/4] use fail_safe option --- products/nativescript/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/nativescript/app.py b/products/nativescript/app.py index 5ae7dd8d..8402db0d 100644 --- a/products/nativescript/app.py +++ b/products/nativescript/app.py @@ -89,4 +89,4 @@ def update(app_name, modules=True, angular=True, typescript=False, web_pack=True # which cannot be resolved on win if Settings.HOST_OS == OSType.WINDOWS: package_json = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json') - File.replace(package_json, 'file://', '\\\\\\\\') + File.replace(package_json, 'file://', '\\\\\\\\', fail_safe=True)