Skip to content

Commit 4675683

Browse files
committed
beta3?
1 parent 0d4e321 commit 4675683

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# fpkg
2+
23
This name stands for **f**oreign **p**ac**k**a**g**e!
34

45
### And what is a "foreign package"?

fpkg

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EDITOR="vim" # change this to your preferred editor
1111

1212
# to restore the terminal state and quit with a code
1313
quit () {
14-
popd > /dev/null # restore user's working directory
14+
popd > /dev/null # restore user's working directory quietly
1515
stty echo # unhide their keystrokes
1616
exit $1 # exit with a given code
1717
}
@@ -28,7 +28,7 @@ exist_check () {
2828
error "package name was not provided!"
2929
fi
3030

31-
grep -w $1 pkg.list > /dev/null 2>&1
31+
grep -w $1 pkg.list > /dev/null 2>&1 # running this just to get its return value
3232
if [[ $? > 0 ]]; then
3333
error "$1 not found in pkg.list! Was it a typo?"
3434
fi
@@ -54,7 +54,7 @@ write_check () {
5454
update () {
5555
# not sure if that's a good implementation
5656
# of it
57-
git pull --recurse-submodules --rebase
57+
git pull --recurse-submodules=on-demand --rebase
5858
# and then move to the previous dir
5959
cd - > /dev/null
6060
}
@@ -239,14 +239,17 @@ case $1 in
239239
write_check
240240

241241
stty echo
242-
entry=$(grep -w "^$2" pkg.list -n | awk -F: '{ print $1 }') # get index of the package
243-
sed -i "$entry"d pkg.list
242+
entry=$(grep -w "^$2" pkg.list -n | awk -F: '{ print $1 }') # get index number of package
243+
sed -i "$entry"d pkg.list # and delete the package using it
244244
rm ii/$2.ii
245245
echo "$2 removed from pkg.list, would you like to remove its files as well? [y/N]"
246246
read choice
247247

248-
if [[ $choice = 'y' ]]; then # same thing but with "no"
248+
if [[ $choice = 'y' ]]; then # same thing but default'ing to "no"
249249
rm -rf $2
250+
if [[ $? = 0 ]]; then
251+
echo "Done"
252+
fi
250253
fi
251254
;;
252255

@@ -293,31 +296,31 @@ case $1 in
293296

294297
# requested the version?
295298
"version" | "v")
296-
echo "fpkg - version 3.0.0-beta2"
297-
echo "ruby R53 (https://github.com/ruby-R53), May 2024"
299+
echo "fpkg, version 3.0.0-beta3."
300+
echo "Written by ruby R53 (https://github.com/ruby-R53) on July 2024"
298301
;;
299302

300303
# didn't even input a valid action or wants to know
301304
# them?
302305
"help" | "h" | *)
303306
echo "Usage: $0 <action> [package]"
304-
echo "Actions:"
305-
echo "help | h - shows this help message"
306-
echo "update | u [pkg] - git pull every package listed in pkg.list, you"
307-
echo " can optionally update only [pkg] as well"
308-
echo "install | i <pkg> - install <pkg> using \$FPKGDIR/ii/<pkg>.ii"
309-
echo "remove | r <pkg> - uninstall <pkg> using \$FPKGDIR/ii/<pkg>.ii also"
310-
echo "list | l - list registered packages"
311-
echo "add | a <pkg> - register <pkg>"
312-
echo "peek | p <pkg> - take a peek at <pkg>'s .ii"
313-
echo "goto | g <pkg> - go to <pkg>'s directory"
314-
echo "edit | e <pkg> - edit <pkg>'s ii file"
315-
echo "delete | d <pkg> - remove <pkg> from pkg.list"
316-
echo "message | m [-d] <pkg> - get comment from last commit of <pkg>. Takes an"
317-
echo " optional -d for getting its diff"
318-
echo "history | H [n] <pkg> - get <pkg>'s commit history. Takes an optional"
319-
echo " [n] to get a custom depth. Defaults to 5"
320-
echo "version | v - get fpkg's version"
307+
echo "Actions (and their short forms):"
308+
echo "(h)elp - shows this help message"
309+
echo "(u)pdate [pkg] - git pull every package listed in pkg.list, you"
310+
echo " can optionally update only [pkg] as well"
311+
echo "(i)nstall <pkg> - install <pkg> using \$FPKGDIR/ii/<pkg>.ii"
312+
echo "(r)emove <pkg> - uninstall <pkg> using \$FPKGDIR/ii/<pkg>.ii also"
313+
echo "(l)ist - list registered packages"
314+
echo "(a)dd <pkg> - register <pkg>"
315+
echo "(p)eek <pkg> - take a peek at <pkg>'s .ii"
316+
echo "(g)oto <pkg> - go to <pkg>'s directory"
317+
echo "(e)dit <pkg> - edit <pkg>'s ii file"
318+
echo "(d)elete <pkg> - remove <pkg> from pkg.list"
319+
echo "(m)essage [-d] <pkg> - get comment from last commit of <pkg>. Takes an"
320+
echo " optional -d for getting its diff"
321+
echo "(H)istory [n] <pkg> - get <pkg>'s commit history. Takes an optional"
322+
echo " [n] to get a custom depth. Defaults to 5"
323+
echo "(v)ersion - get fpkg's version"
321324

322325
# exit with error if input wasn't
323326
# for the help text

0 commit comments

Comments
 (0)