diff --git a/change/react-native-windows-2020-04-30-12-57-06-fix-apppackage-path.json b/change/react-native-windows-2020-04-30-12-57-06-fix-apppackage-path.json new file mode 100644 index 00000000000..d5f06326741 --- /dev/null +++ b/change/react-native-windows-2020-04-30-12-57-06-fix-apppackage-path.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "fix appPackage path", + "packageName": "react-native-windows", + "email": "kaigu@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-04-30T19:57:06.111Z" +} diff --git a/vnext/local-cli/runWindows/utils/deploy.js b/vnext/local-cli/runWindows/utils/deploy.js index b302f84a6bb..d32b6530f05 100644 --- a/vnext/local-cli/runWindows/utils/deploy.js +++ b/vnext/local-cli/runWindows/utils/deploy.js @@ -45,7 +45,10 @@ function getAppPackage(options) { options.arch === 'x86' ? `{*_x86_${configuration}_*,*_Win32_${configuration}_*}` : `*_${options.arch}_${configuration}_*`; - const appPackageGlob = `windows/{*/AppPackages,AppPackages/*}/${packageFolder}`; + + const appPackageGlob = `${ + options.root + }/windows/{*/AppPackages,AppPackages/*}/${packageFolder}`; let appPackage = glob.sync(appPackageGlob)[0]; if (!appPackage && options.release) { @@ -53,8 +56,11 @@ function getAppPackage(options) { newWarn( 'No package found in *_Release_* folder, remove _Release_ and check again', ); + appPackage = glob.sync( - `windows/{*/AppPackages,AppPackages/*}/*_${options.arch}_*`, + `${options.root}/windows/{*/AppPackages,AppPackages/*}/*_${ + options.arch + }_*`, )[0]; } @@ -192,8 +198,6 @@ async function deployToDesktop(options, verbose, slnFile) { } } - const popd = pushd(options.root); - await runPowerShellScriptFunction( 'Removing old version of the app', windowsStoreAppUtils, @@ -259,8 +263,6 @@ async function deployToDesktop(options, verbose, slnFile) { } else { newInfo('Skip the step to start the app'); } - - popd(); } function startServerInNewWindow(options, verbose) {