Skip to content

Fix crash with --instructions and --instructions-deploy - #155

Merged
kylemclaren merged 1 commit into
fly-apps:mainfrom
alexleventer:fix-instructions-alias
Oct 22, 2026
Merged

kylemclaren merged 1 commit into
fly-apps:mainfrom
alexleventer:fix-instructions-alias

Conversation

@alexleventer

Copy link
Copy Markdown
Contributor

Fixes #144.

Problem

--instructions-deploy=<file> and its alias --instructions=<file> crash before generating anything:

TypeError: Cannot create property 'deploy' on string 'install.packages'
    at index.js:307

instructions is also a key in defaults (the { base, build, deploy } object). Because yargs sets the alias key too, options.instructions becomes the file name string. The loop that copies changed defaults into package.json then writes dockerfile.instructions = "<file>". The per-stage code a few lines later does df.instructions[stage] = ... on that string and throws. --instructions-base and --instructions-build have no alias, so they work.

Change

Skip instructions in the defaults loop. The per-stage loop below it already reads options['instructions-<stage>'] and maintains dockerfile.instructions in package.json, so nothing else needs to change.

Testing

In a scratch app with package.json and deploy.txt containing RUN echo hi:

  • --instructions-deploy=deploy.txt: crashed on main. Now exits 0, the Dockerfile contains RUN echo hi, and package.json gets "dockerfile": {"instructions": {"deploy": "deploy.txt"}}.
  • --instructions=deploy.txt: same result.
  • Re-running with no flags keeps the instructions.
  • --instructions= removes them from the Dockerfile and from package.json.

eslint clean. npm test: 126 passing, 3 failing (bun base/cache-bun, svelte-bun), the same 3 that fail on main without bun installed.

🤖 Generated with Claude Code

@kylemclaren
kylemclaren merged commit 734ca6a into fly-apps:main Oct 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does --instructions-deploy not work?

2 participants