-
Notifications
You must be signed in to change notification settings - Fork 4
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
make.py: fix trailing slash problem #21
base: master
Are you sure you want to change the base?
Conversation
Hm. From scrolling through this seems not to work if somebody uses a path for the folder (so you have multiple "/" in the path); I don't know python enough to be sure about this, though. |
It seems to work, in a weird way though: djcj ~ $ ./make.py Downloads/nightingale-addons-master/equalizerpane/
Downloadsnightingale-addons-masterequalizerpane-1.0.11.xpi could not be written.
djcj ~ $ ls *.xpi
Downloadsnightingale-addons-masterequalizerpane-1.0.11.xpi
djcj ~ $ |
I wouldn't call it working. It is what I expected :P |
Couldn't you use a simple regular expression with something like |
I'll see what I can do, but to be honest I don't know too much about writing python scripts. edit: #!/bin/sh
if [ -z "$1" ] ; then
echo "usage: $0 <path>"
exit 1
fi
version=$(grep -e "em:version" "$1"/install.rdf | cut -d '>' -f2 | cut -d '<' -f1)
xpiName=$(echo $(basename "$1")-$version.xpi)
basedir=$(pwd)
cd "$1" && zip -r "$basedir/$xpiName" ./*
if [ -f "$basedir/$xpiName" ] ; then
echo "'$basedir/$xpiName' successfully written."
exit 0
else
echo "'$basedir/$xpiName' could not be written."
exit 1
fi |
The regular expression that kills the trailing |
I've got it. Now it only removes the trailing slash and make.py can be run from other directories. |
So, do you want this fix or should I close this PR? |
Looks fine to me, although I didn't test it. Imho some notes about where to find the built file (after the patch: in the working directory if I read this right) would be fine in the readme as well, but that should not oppose a merge. |
No description provided.