pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Builder fails to find path if providing a project-directory argument on run #266

Closed michael-hawker closed 7 years ago

michael-hawker commented 7 years ago

Manifold project at c:\code\HWA\PWABuilder\ManifoldJS\

Used tool to setup project in another directory: PS C:\code\HWA\PWABuilder\ManifoldJS> node manifoldjs http://www.ted.com/ -d ../TED

Works fine from project directory (and manifold in other directory): PS C:\code\HWA\PWABuilder\TED\WwwTedCom> node ..\..\ManifoldJS\manifoldjs.js run windows10

However, if trying to stay in manifold root and run project, it fails: PS C:\code\HWA\PWABuilder\ManifoldJS> node .\manifoldjs.js run windows10 ..\TED\WwwTedCom\

[error] manifoldjs  : Failed to launch the Windows 10 Platform app.
                      Command failed: powershell -noprofile -noninteractive -ExecutionPolicy Bypass -Command "C:\code\HWA\PWABuilder\ManifoldJS\node_modules\hwa\AppxUtilities\Start.ps1 'C
:\code\HWA\PWABuilder\ManifoldJS\node_modules\hwa' 'INSERT-YOUR-PACKAGE-IDENTITY-NAME-HERE' '..\TED\WwwTedCom\windows10\manifest\appxmanifest.xml'"
                      dir : Cannot find path 'C:\code\HWA\PWABuilder\**ManifoldJS\node_modules**\TED\WwwTedCom\windows10\manifest\appxmanifest.xml' because it does not exist.
                      At C:\code\HWA\PWABuilder\ManifoldJS\node_modules\hwa\AppxUtilities\Add-AppxPackageExt.ps1:92 char:14
                      +     elseif ((dir $Path).Name -eq "appxmanifest.xml") {
                      +              ~~~~~~~~~
                          + CategoryInfo          : ObjectNotFound: (C:\code\HWA\PWA...ppxmanifest.xml:String) [Get-ChildItem], ItemNotFoundException
                          + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
                          For more information, run manifoldjs with the diagnostics level set to debug (e.g. manifoldjs [...] -l debug)

Appears like one of the tools is trying to look at the relative path from it's location instead of where manifold.js was run from.

boyofgreen commented 7 years ago

We have a few path issues, specifically around launching commands like "build" and "run" from different parts of the directory

rnrneverdies commented 7 years ago

Fixed, will be available in the next major release.