Skip to content

hexa init --just=hosting fails if public folder isn't created #18

@manekinekko

Description

@manekinekko

Describe the bug

hexa init --just=hosting
? Enter a name for the project: angularhexa
✔ Checking for existing project angularhexa...
✔ Bootstrapping project angularhexa...
✔ Checking authorizations for project angularhexa...
✔ Checking storage for project angularhexa...
✔ Fetching a connection string for storage account angularhexa81052...
? Enter public folder (will be created if not present): ./dist/angular-hexa

(node:85864) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at InputPrompt.onError (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/lib/prompts/input.js:95:35)
    at SafeSubscriber._next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Observable.js:66:21)
    at SafeSubscriber.__tryOrUnsub (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:143:22)
    at Subscriber._next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:66:18)
    at TakeUntilSubscriber.Subscriber._next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:89:26)
    at TakeUntilSubscriber.Subscriber.next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:66:18)
    at FilterSubscriber._next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/operators/filter.js:52:30)
    at FilterSubscriber.Subscriber.next (/Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/node_modules/inquirer/node_modules/rxjs/internal/Subscriber.js:66:18)
(node:85864) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:85864) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
? Enter public folder (will be created if not present): undefined
✔ Enabling hosting for storage account angularhexa81052...
✔ Configuration saved to /Users/wassimchegham/oss/hexa_deploy_angular/angular-hexa/hexa.json
✔ Done in 36 seconds.

Additional context

We need to make sure the public folder does exists before deployment. Currently, that check is done during the init phase. Also, usually the dist/build folder are usually created by the build process and thus may or may not be available when we run hexa init.

We may need to refactor this function: https://github.com/manekinekko/hexa/blob/master/src/core/utils.ts#L188

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions