Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(iac): deny deployment if localPath does not contain files (#3181)
Will Hutchinson52f7008e5054
diff --git a/infra/bun.lock b/infra/bun.lockindex 6d95ebcf0d..141c1eee05 100644--- a/infra/bun.lock+++ b/infra/bun.lock@@ -40,6 +40,10 @@"name": "shared","version": "0.0.0",},+ "packages/utils": {+ "name": "utils",+ "version": "0.0.0",+ },"packages/vpc": {"name": "vpc","version": "0.0.0",@@ -1010,6 +1014,8 @@"util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],+ "utils": ["utils@workspace:packages/utils"],+"uuid": ["[email protected]", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="],"v8-compile-cache-lib": ["[email protected]", "", {}, "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg=="],diff --git a/infra/packages/utils/package.json b/infra/packages/utils/package.jsonnew file mode 100644index 0000000000..475a07ee0b--- /dev/null+++ b/infra/packages/utils/package.json@@ -0,0 +1,11 @@+{+ "name": "utils",+ "version": "0.0.0",+ "private": true,+ "license": "MIT",+ "main": "./src/index.ts",+ "scripts": {+ "lint": "biome lint .",+ "typecheck": "tsc --noEmit"+ }+}diff --git a/infra/packages/utils/src/index.ts b/infra/packages/utils/src/index.tsnew file mode 100644index 0000000000..e191264bd8--- /dev/null+++ b/infra/packages/utils/src/index.ts@@ -0,0 +1,15 @@+import * as fs from 'fs';+import * as path from 'path';++/**+ * Returns whether the given folder path contains any items+ **/+export function hasItems(folderPath: string): boolean {+ const resolvedPath = path.resolve(folderPath);++ if (!fs.existsSync(resolvedPath)) {+ return false;+ }++ return fs.readdirSync(resolvedPath).length > 0;+}diff --git a/infra/packages/utils/tsconfig.json b/infra/packages/utils/tsconfig.jsonnew file mode 100644index 0000000000..4082f16a5d--- /dev/null+++ b/infra/packages/utils/tsconfig.json@@ -0,0 +1,3 @@+{+ "extends": "../../tsconfig.json"+}diff --git a/infra/stacks/web-app/index.ts b/infra/stacks/web-app/index.tsindex 83724b1625..1b6f9812a2 100644--- a/infra/stacks/web-app/index.ts+++ b/infra/stacks/web-app/index.ts@@ -5,10 +5,17 @@ import * as command from '@pulumi/command';import * as datadog from '@pulumi/datadog';import * as pulumi from '@pulumi/pulumi';import * as datadogEntity from './datadog-entity.json';+import { hasItems } from '../../packages/utils';// Import the program's configurationconst config = new pulumi.Config();const localPath: string = config.require('path');++// Make sure there are items in the `localPath`+if (!hasItems(localPath)) {+ throw new Error('Local path of build output is empty');+}+const indexDocument = config.get('indexDocument') || 'index.html';// Get current Stack name