[go: up one dir, main page]

Skip to content

GrzegorzDrozd/handleWith

Repository files navigation

#!/bin/bash

# variables
ID="handleWith"
BRANCH="main"

# check requirements
MISSING_REQ=0
for req in mktemp wget unzip zip grep cut date;do
	type $req >/dev/null 2>&1 || { echo >&2 "Missing dependency: $req"; MISSING_REQ=1; }
done

[ $MISSING_REQ -ne 0 ] && { echo "Aborting because of missing dependency"; exit 1; }

# create tmp storage
ZIPFILE=$(mktemp)
EXTRDIR=$(mktemp -d)

# download latest source
wget -q --show-progress "https://github.com/igorlogius/$ID/archive/$BRANCH.zip" -O $ZIPFILE

# extract without paths and README
unzip -j $ZIPFILE -d $EXTRDIR -x "*/README" "*/handleWith.sh" "*/handleWith.py" "*/handleWith.bat" "*/handleWith.js"

# re-pack as xpi (zip) without paths and extended file attributes 
XPI="$ID-$(grep '"version"' $EXTRDIR/manifest.json |cut -d'"' -f4)-$(date '+%F_%T').xpi" 
zip -X -j $XPI $EXTRDIR/*

# remove tmp storage
rm -f $EXTRDIR/* && rmdir $EXTRDIR/

# show content of xpi
unzip -l $XPI

echo "Homepage: https://addons.mozilla.org/en-US/firefox/addon/$ID"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published