Skip to content

Commit

Permalink
Merge pull request ivan-hc#480 from ivan-hc/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-hc authored Apr 24, 2024
2 parents a837ab5 + e8ab02e commit 61c52e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
21 changes: 10 additions & 11 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/sh

# CREATING THE MAIN FOLDER FOR "AM"
# CREATING THE MAIN DIRECTORY FOR "AM"
mkdir -p /opt/am/.cache /opt/am/modules
cd /opt/am
cd /opt/am || exit

# CREATE THE SCRIPT NEEDED TO UNINSTALL "AM"
rm -R -f /opt/am/remove
echo "#!/bin/sh
rm -R -f /usr/local/bin/am /opt/am /etc/bash_completion.d/am-completion.sh" >> /opt/am/remove
echo '#!/bin/sh
rm -R -f /usr/local/bin/am /opt/am /etc/bash_completion.d/am-completion.sh' >> /opt/am/remove
chmod a+x /opt/am/remove

# DOWNLOAD THE MAIN SCRIPT
Expand All @@ -25,9 +25,9 @@ wget -q "https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/p
MODULES=$(wget -q https://api.github.com/repos/ivan-hc/AM/contents/modules -O - | grep download_url | cut -d '"' -f 4)
for module in $MODULES; do
for v in $module; do
cd /opt/am/modules
cd /opt/am/modules || tmp
mkdir tmp
cd tmp
cd tmp || tmp
wget -q "$v"
cd ..
mv tmp/*.am ./
Expand All @@ -36,16 +36,15 @@ for module in $MODULES; do
done
done

# ENABLE NON-ROOT PERMISSIONS TO THE MAIN FOLDER FOR THE CURRENT USER
# ENABLE NON-ROOT PERMISSIONS TO THE MAIN DIRECTORY FOR THE CURRENT USER
currentuser=$(who | awk '{print $1}')
chown -R $currentuser /opt/am 2> /dev/null

# ADD THE BASH COMPLETION SCRIPT
echo '#!/usr/bin/env bash' >> /opt/am/am-completion.sh; echo 'complete -W "$(cat /opt/am/list 2>/dev/null)" am' >> /opt/am/am-completion.sh
echo '#!/usr/bin/env bash
complete -W "$(cat /opt/am/list 2>/dev/null)" am' >> /opt/am/am-completion.sh
chmod a+x /opt/am/am-completion.sh
rm -R -f /opt/am/remove; echo '#!/bin/sh' >> /opt/am/remove
echo 'rm -R -f /usr/local/bin/am /opt/am /etc/bash_completion.d/am-completion.sh' >> /opt/am/remove
chmod a+x /opt/am/remove; chown -R $currentuser /opt/am/remove 2>/dev/null

if test -f /etc/bash_completion.d; then
mv /opt/am/am-completion.sh /etc/bash_completion.d/
else
Expand Down
1 change: 0 additions & 1 deletion modules/install.am
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ while [ -n "$1" ]; do
echo -e " 💀 ERROR DURING INSTALLATION, REMOVED $(echo '"'$arg'"' | tr a-z A-Z)!"
$AMCLIPATH -R $LATESTDIR 1> /dev/null
else
chown -R $currentuser $AMPATH/.cache/about 2> /dev/null
for metapackage in $(echo "$METAPACKAGES"); do
if grep -q "$metapackage" ./$arg 2> /dev/null; then
metascript=$(cd $APPSPATH && ls -td * | head -1)
Expand Down
2 changes: 1 addition & 1 deletion programs/x86_64/deadbeef-appimage
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ln -s "/opt/$APP/$APP" "/usr/local/bin/$APP"
# SCRIPT TO UPDATE THE PROGRAM
cat >> /opt/"$APP"/AM-updater << 'EOF'
#!/bin/sh
APP=deadbeef-devel-appimage
APP=deadbeef-appimage
REPO="Samueru-sama/DeaDBeef-AppImage"
version0=$(cat /opt/$APP/version)
version=$(wget -q https://api.github.com/repos/$REPO/releases -O - | grep browser_download_url | grep -i appimage | cut -d '"' -f 4 | head -1)
Expand Down

0 comments on commit 61c52e0

Please sign in to comment.