Skip to content

Commit 8ecd0ef

Browse files
authored
fix: win path in package.json (#443)
* fix path on win * fix paths on windows * update variable name * use fail_safe option
1 parent 577f1d4 commit 8ecd0ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

products/nativescript/app.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
import os
33

44
from core.settings import Settings
5-
from core.utils.file_utils import Folder
5+
from core.utils.file_utils import Folder, File
66
from core.utils.json_utils import JsonUtils
77
from core.utils.npm import Npm
88
from core.utils.run import run
9+
from core.enums.os_type import OSType
910

1011

1112
class App(object):
@@ -84,3 +85,8 @@ def update(app_name, modules=True, angular=True, typescript=False, web_pack=True
8485
if vue and App.is_dependency(app_name=app_name, dependency='nativescript-vue'):
8586
Npm.uninstall(package='nativescript-vue', option='--save', folder=app_path)
8687
Npm.install(package='nativescript-vue@next', option='--save --save-exact', folder=app_path)
88+
# on win when `npm i` is executed with path to .tgz it saves in package.json unix style path
89+
# which cannot be resolved on win
90+
if Settings.HOST_OS == OSType.WINDOWS:
91+
package_json = os.path.join(Settings.TEST_RUN_HOME, app_name, 'package.json')
92+
File.replace(package_json, 'file://', '\\\\\\\\', fail_safe=True)

0 commit comments

Comments
 (0)