@factorypure/devdb 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/devdb.js +5 -2
  2. package/package.json +2 -2
package/bin/devdb.js CHANGED
@@ -21,7 +21,7 @@ const KEEP_GOLDENS = 2
21
21
  const MYSQL_BIN = process.env.DEVDB_MYSQL_BIN ?? '/opt/homebrew/opt/mysql@8.4/bin'
22
22
  const NAME_PATTERN = /^[a-z0-9][a-z0-9._-]{0,40}$/i
23
23
 
24
- const HELP = `devdb - local copies of the prod database (refreshed nightly by fpjobs dev-db-snapshot)
24
+ const HELP = `devdb - local copies of the prod database (refreshed weekly on Mondays by fpjobs dev-db-snapshot)
25
25
 
26
26
  devdb pull [--env FILE] [--force] download the latest snapshot and load it into a new golden copy
27
27
  (--env: create the DB_USER/DB_PASSWORD app user from that .env;
@@ -407,6 +407,8 @@ const commands = {
407
407
  } finally {
408
408
  await stopServer(loader)
409
409
  }
410
+ // --force reloads an existing stamp; clones are APFS copies, so replacing the golden doesn't touch them
411
+ fs.rmSync(path.join(GOLDENS, stamp), { recursive: true, force: true })
410
412
  fs.renameSync(loadingDir, path.join(GOLDENS, stamp))
411
413
  fs.rmSync(dumpDir, { recursive: true, force: true })
412
414
 
@@ -533,7 +535,8 @@ const commands = {
533
535
  ['mysqld (brew install mysql@8.4)', () => capture(bin('mysqld'), ['--version'])],
534
536
  ['zstd (brew install zstd)', () => capture('zstd', ['--version'])],
535
537
  ['aws cli', () => capture('aws', ['--version'])],
536
- ['AWS credentials (aws sso login)', () => capture('aws', ['s3', 'ls', `s3://${BUCKET}/dev-db/`])],
538
+ // `aws s3 ls` exits 1 on an empty prefix; list-objects-v2 doesn't
539
+ ['AWS credentials (aws sso login)', () => capture('aws', ['s3api', 'list-objects-v2', '--bucket', BUCKET, '--prefix', 'dev-db/', '--max-keys', '1'])],
537
540
  ]
538
541
  let ok = true
539
542
  for (const [label, check] of checks) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@factorypure/devdb",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Local copies of the prod MySQL database for development",
5
5
  "type": "module",
6
6
  "bin": {
7
- "devdb": "./bin/devdb.js"
7
+ "devdb": "bin/devdb.js"
8
8
  },
9
9
  "files": [
10
10
  "bin"