New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/shell template improvements #1006

Merged
merged 3 commits into from Nov 7, 2015

Conversation

Projects
None yet
3 participants
@ehealy
Contributor

ehealy commented Sep 14, 2015

A couple of small improvements and some new functionality that makes the package metadata useful in the post install actions.

@ehealy

This comment has been minimized.

Contributor

ehealy commented Oct 13, 2015

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Nov 7, 2015

Haven't tested; but change looks ok :)

Thanks! <3

jordansissel added a commit that referenced this pull request Nov 7, 2015

@jordansissel jordansissel merged commit 8f076ce into jordansissel:master Nov 7, 2015

@ehealy ehealy referenced this pull request Jan 4, 2016

Closed

Version bump to v 1.4.1 #1057

@glensc

This comment has been minimized.

glensc commented on templates/sh.erb in 6d470fb Jan 6, 2016

your shell syntax is broken if no body is to be declared, at least type ":" in there or omit whole method:

$ cat /tmp/test.sh 
foo() {
}
$ bash /tmp/test.sh 
/tmp/test.sh: line 2: syntax error near unexpected token `}'
/tmp/test.sh: line 2: `}'

$ cat /tmp/test2.sh 
foo() {
        :
}
$ bash /tmp/test2.sh 
$

but ideally it should be covered if you wrote tests for this. can respond_to?(:package_metadata) ever be false?

@ehealy

This comment has been minimized.

Contributor

ehealy commented Feb 11, 2016

@glensc apologies for the delayed response. I'll see what I can do about fortifying this and increasing test coverage. The respond_to? logic was added in order to allow fpm to be backwards compatible with some older packages we had created with it prior to the addition of metadata to packages.

@glensc

This comment has been minimized.

Contributor

glensc commented Feb 11, 2016

just remember, empty functions are not allowed in shell syntax. this results syntax error:

foo() {
}

jordansissel added a commit that referenced this pull request Jun 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment