Missing version in custom `.htaccess` builds
florianbouvot opened this issue · 8 comments
Thanks for raising this issue @florianbouvot.
The version is extracted from the package.json
file located at the root of the repository.
server-configs-apache/bin/build.sh
Lines 17 to 18 in 1653141
Do you confirm the file does exist on your side?
@LeoColomb yes package.json is present.
I do the following things:
- In the root of our project:
git clone https://github.com/h5bp/server-configs-apache.git
- Update path in my htaccess.conf (present in root project):
h5bp/
toserver-configs-apache/h5bp/
(never add to do that before) - Build using:
server-configs-apache/bin/build.sh ./.htaccess ./htaccess.conf
- Build using:
server-configs-apache/bin/build.sh ./.htaccess ./htaccess.conf
And this does not generate any warnings?
What is the output of the command?
@LeoColomb the output
OK, so the command is missing on that system. Seems to me though that the realpath command is nothing new in our *nix eco systems as it stems from 2007 or 2008 [1] and also found its way into GNU coreutils 10 years ago [2].
As a quick fix for @florianbouvot I'd propose installing the realpath command (simple one-liner) [3], so he's up and running again in 5 minutes.
Because of the ages-old availability of this command I do not feel a sophisticated fallback solution is necessary. But a nicer error handling could improve screen experience, perhaps something like this:
function require {
command -v $1 >/dev/null 2>&1 || {
echo >&2 "Command '${1}' is required but not installed."
exit 1;
}
}
require realpath
If needed I can provide PR this weekend.
[1] https://stackoverflow.com/a/284664
[2] coreutils/coreutils@77ea441
[3] https://command-not-found.com/realpath
@florianbouvot You are using MacOs which doesn't have realpath
by default. If you have Homebrew installed then brew install coreutils
will solve your issue.
If you don't have Homebrew installed then I would recommend installing Homebrew. 😃
@nosilleg yes I'm using macOS and of course Home-brew, it's the first time that it doesn't works.
I will try with coreutils
.
EDIT: It works well, thanks you ;)