Skip to content

Commit

Permalink
feat(web): inhert script process logs if verbose or debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eahefnawy committed Sep 24, 2024
1 parent c04bbc4 commit 7ab434d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
name: Deploy main branch

on:
push:
branches:
- main
pull_request:
branches:
- main
pull_request_target:
types:
- closed

jobs:
deploy:
name: deploy
if: github.event_name != 'pull_request_target' || github.event.pull_request.merged != true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -35,14 +28,13 @@ jobs:
- name: Serverless Deploy
uses: serverless/github-action@v4
with:
args: deploy --stage ${{ github.event.pull_request.number && 'pr-${{ github.event.pull_request.number }}' || 'prod' }}
args: deploy --stage pr-${{ github.event.pull_request.number }}
env:
SERVERLESS_LICENSE_KEY: ${{ secrets.SERVERLESS_LICENSE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
remove:
name: remove
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
13 changes: 11 additions & 2 deletions website/scripts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { execSync } from "child_process";

class Scripts {
constructor(serverless) {
constructor(serverless, options, utils) {
this.serverless = serverless;
this.options = options;
this.utils = utils;

this.commands = {};
this.hooks = {};

Expand Down Expand Up @@ -53,7 +56,13 @@ class Scripts {
}

execute(command) {
execSync(command, { stdio: ["ignore", "ignore", "inherit"] });
let stdio = ["ignore", "ignore", "inherit"];

if (this.options.verbose || this.options.debug) {
stdio = "inherit";
}

execSync(command, { stdio });
}
}

Expand Down

0 comments on commit 7ab434d

Please sign in to comment.