fpm icon indicating copy to clipboard operation
fpm copied to clipboard

Use bash in deb templates

Open mkenigs opened this issue 3 years ago • 3 comments

Currently, fpm has a bug where if I use #!bash for an --after-install script that uses bash specific features, it works, but if I add an --after-upgrade script, the previously working --after-install script now fails, because the script is now run with sh.

If this change is too opinionated, maybe an alternative fix would be to respect the shebang in the --after-install script?

mkenigs avatar May 18 '22 19:05 mkenigs

maybe an alternative fix would be to respect the shebang in the --after-install script?

I like this alternate proposal, though I understand the implementation might be trickier.

automatically choosing the right shebang line seems like a good approach. Default to /bin/sh unless a script uses something else. We might need to detect conflicting shebang lines, like if after upgrade and after install have different shebang lines?

jordansissel avatar May 20 '22 07:05 jordansissel

Yeah that'd probably be better! Don't think I have time to do it that way right now because I have a workaround for what I'm using it for

mkenigs avatar May 20 '22 14:05 mkenigs

Don't think I have time to do it that way right now

No worries! We can make forward progress as time permits for anyone available to do the work (including myself). For now, I'm glad we could bounce ideas and come up with a solution that should work well, while you at least have a decent work around for yourself. <3

jordansissel avatar May 26 '22 20:05 jordansissel