mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
The file extension .png will be added only if the file has extensions other than .png or .PNG (#150)
This commit is contained in:
parent
103040f2fb
commit
228893ccbd
2 changed files with 10 additions and 1 deletions
11
qrify/qrify
11
qrify/qrify
|
@ -87,9 +87,18 @@ makeqr()
|
||||||
# redirects the image obtained from the goqr api into a png file
|
# redirects the image obtained from the goqr api into a png file
|
||||||
function makeQRFile {
|
function makeQRFile {
|
||||||
input=$(echo "$input" | sed -e s/" "/%20/g -e s/'\\n'/%0A/g ) ##same as in the makeqr function
|
input=$(echo "$input" | sed -e s/" "/%20/g -e s/'\\n'/%0A/g ) ##same as in the makeqr function
|
||||||
httpGet "api.qrserver.com/v1/create-qr-code/?size=150x150&data=$input" > $fileName.png
|
|
||||||
|
addFileExt
|
||||||
|
|
||||||
|
httpGet "api.qrserver.com/v1/create-qr-code/?size=150x150&data=$input" > $fileName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addFileExt {
|
||||||
|
if ! echo "$fileName" | grep -E -q ".*\.png$|.*\.PNG$"
|
||||||
|
then
|
||||||
|
fileName="$fileName.png"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
makeMultiLineQr()
|
makeMultiLineQr()
|
||||||
{
|
{
|
||||||
|
|
BIN
qrify/qrify.png
BIN
qrify/qrify.png
Binary file not shown.
Before Width: | Height: | Size: 30 KiB |
Loading…
Reference in a new issue