Skip to content

Commit

Permalink
fix(cli-watch-command): correct glob generation
Browse files Browse the repository at this point in the history
* fix: remove empty if statement

* fix: correct glob generation
  • Loading branch information
adrians5j committed Jul 15, 2022
1 parent 4db06af commit 17491fd
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/cli-plugin-deploy-pulumi/commands/watch.js
Expand Up @@ -117,8 +117,6 @@ module.exports = async (inputs, context) => {
}

let output = terminalOutput;
if (inputs.output === "browser") {
}

switch (inputs.output) {
case "browser":
Expand Down Expand Up @@ -206,11 +204,17 @@ module.exports = async (inputs, context) => {
message: chalk.green("Watching cloud infrastructure resources...")
});

const buildFoldersGlob = [
projectApplication.project.workspace,
inputs.folder,
"**/build"
].join("/");
let buildFoldersGlob = [projectApplication.paths.workspace, "**/build/*.js"].join("/");

// For non-workspaces projects, we still want to be watching `**/build/*.js` files located
// in user's project (for example `api/graphql/code/build/handler.js`).
if (projectApplication.type !== "v5-workspaces") {
buildFoldersGlob = [
projectApplication.paths.absolute,
inputs.folder,
"**/build/*.js"
].join("/");
}

const buildFolders = glob.sync(buildFoldersGlob, { onlyFiles: false });

Expand Down Expand Up @@ -243,7 +247,6 @@ module.exports = async (inputs, context) => {

const pulumi = await getPulumi({ projectApplication });

// We only watch "code/**/build" and "pulumi" folders.
const watchCloudInfrastructure = pulumi.run({
command: "watch",
args: {
Expand Down

0 comments on commit 17491fd

Please sign in to comment.