Skip to content

Commit

Permalink
Fix appPackage path in deploy.js (#4762)
Browse files Browse the repository at this point in the history
* fix appPackage path

* Change files

* More fix

* lint fix

* Concat paths directly
  • Loading branch information
kaiguo authored and NickGerleman committed May 14, 2020
1 parent d3dc027 commit a42964e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 8 additions & 6 deletions vnext/local-cli/runWindows/utils/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,22 @@ 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) {
// in the latest vs, Release is removed
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];
}

Expand Down Expand Up @@ -192,8 +198,6 @@ async function deployToDesktop(options, verbose, slnFile) {
}
}

const popd = pushd(options.root);

await runPowerShellScriptFunction(
'Removing old version of the app',
windowsStoreAppUtils,
Expand Down Expand Up @@ -259,8 +263,6 @@ async function deployToDesktop(options, verbose, slnFile) {
} else {
newInfo('Skip the step to start the app');
}

popd();
}

function startServerInNewWindow(options, verbose) {
Expand Down

0 comments on commit a42964e

Please sign in to comment.