Skip to content
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

this pull request is a meme and should not be taken seriously #16

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,29 @@ Dependencies: curl, jq (jq is included in the AppImage release)
## Arguments

```
list|l - list all available packages
list|l - list all available packages

info|i - output information for a package
info|i - output json file containing information for a package

search|se - search for available packages
search|se - search for available packages

install|in - install a package to $TARGET_DIR
install|in - install a package to $TARGET_DIR

get - install a package to $GET_DIR without managing it
get - install a package to $GET_DIR without managing it

remove|rm - remove an installed package
remove|rm - remove an installed package

update|up - update list of packages and check installed packages for updates
update|up - update list of packages and check installed packages for updates

revert|rev - revert an updated package to its previous version if available
revert|rev - revert an updated package to its previous version if available

freeze|fr - mark or unmark a package as FROZEN to prevent update checks
freeze|fr - mark or unmark a package as FROZEN to prevent update checks

config|cf - open spm's config file with $EDITOR
config|cf - open spm's config file with /usr/bin/nano

inpuylet|install-puylet - install a puylet

rmpuylet|remove-puylet - remove an installed puylet
```

## Additional Arguments
Expand Down
97 changes: 86 additions & 11 deletions spm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,68 @@
# License: GPL v2.0 only

# Function to handle all exits
function fetch() {
{
mkdir -p "$puyo/pkgs/"
} &> /dev/null
source $2
if [ -z "$file" ]; then
echo "You seem to be installing from an invalid puylet."
fi
wget -P ~/.puyo/pkgs/ "$file"
}
function puylet() {
puyo="$HOME/.puyo"
case "$1" in
install)
fetch $@
{
finder=$(find "$puyo/pkgs/" | grep "$2")
lengths=$(find "$puyo/pkgs/" | grep -c "$2")
source $2
} &> /dev/null
if (( lengths == 1 )); then
lengths=lengths
else
echo "We didn't find your package."
exit 1
fi
{
mkdir -p "$puyo/temp/"
cp "$finder" "$puyo/temp/"
ls "$puyo/temp/"
filename="$name.tar.gz"
tar -xvf "$puyo/temp/$filename" -C "$puyo/temp/"
rm "$puyo/temp/$filename"
mkdir -p "$puyo/installed/"
mkdir -p "$dir"
mv "$puyo/temp/$name" "$puyo/installed/"
} &> /dev/null
sudo mv "$puyo/temp/"* "$dir"
;;
uninstall)
{
lengths=$(find "$puyo/installed/" | grep -c "$2")
} &> /dev/null
if ((lengths == 1 )); then
lengths=lengths
else
echo "$2 is not installed!"
exit 1
fi
{
name="$2"
source "$puyo/installed/$name"
for file in $files
do
sudo rm $file
done
rm "$puyo/installed/$name"
} &> /dev/null
;;
esac

}
function spmexit() {
case $1 in
# normal exit; remove cache before exiting
Expand Down Expand Up @@ -753,23 +815,26 @@ function spmconfig() {

# Function to output help text
function spmhelp() {
printf '%s\n' "spm 0.2.05
printf '%s\n' "spm+p 0.2.05
Usage: spm [option] [package]
spm is a command line package manager provides packages in AppImage format.
spm uses https://github.com/simoniz0r/spm/releases/download/feed/spm-feed.json
to get information about packages.

Arguments:
list|l - list all available packages
info|i - output json file containing information for a package
search|se - search for available packages
install|in - install a package to $TARGET_DIR
get - install a package to $GET_DIR without managing it
remove|rm - remove an installed package
update|up - update list of packages and check installed packages for updates
revert|rev - revert an updated package to its previous version if available
freeze|fr - mark or unmark a package as FROZEN to prevent update checks
config|cf - open spm's config file with $EDITOR
list|l - list all available packages
info|i - output json file containing information for a package
search|se - search for available packages
install|in - install a package to $TARGET_DIR
get - install a package to $GET_DIR without managing it
remove|rm - remove an installed package
update|up - update list of packages and check installed packages for updates
revert|rev - revert an updated package to its previous version if available
freeze|fr - mark or unmark a package as FROZEN to prevent update checks
config|cf - open spm's config file with $EDITOR
inpuylet|install-puylet - install a puylet
rmpuylet|remove-puylet - remove an installed puylet

Additional Arguments:
[list|info] --installed|-i - show list or info for installed packages
--debug [option] [package] - add bash option 'set -x' for debugging
Expand Down Expand Up @@ -1059,6 +1124,16 @@ case $ARG in
# fi
# spmexit "0"
# ;;
install-puylet|inpuylet)
puyocheck "$@"
echo "${nc}Installing ${green}${@:2}..."
puylet install "$2"
;;
remove-puylet|rmpuylet)
puyocheck "$@"
echo "${nc}Removing ${green}${@:2}..."
puylet uninstall "$2"
;;
*)
spmhelp
spmexit "0"
Expand Down