Skip to content

Commit a6206d1

Browse files
committed
release 2.1.0, see CHANGELOG
1 parent 8ecd593 commit a6206d1

File tree

4 files changed

+58
-10
lines changed

4 files changed

+58
-10
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
April 28, 2024:
2+
- Version 2.1.0 is out!
3+
- The package manager is stupid, and that's because I am
4+
stupid.
5+
- Fixed the 'add' command: it checks the argument
6+
better now, and can add the package properly.
7+
See the diff :)
8+
- Added command 'remove': now fpkg is able to uninstall
9+
packages too! Update your .ii's accordingly now!
10+
- Added a TODO file
11+
- So that I can write down stuff I could implement one
12+
day
13+
114
March 25 - April 8, 2024:
215
- Version 2.0.0 is out already!
316
- Improved error handling some more

TODO

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Stuff I'm thinking of implementing one day:
2+
- Logging, so that the user can track down when a build fails
3+
- Dependency checking - I'm really unsure of how I would
4+
implement that, though!
5+
- Commit history support, so that the user doesn't see only
6+
the latest commit on the package
7+
- That's it for now :)

fpkg

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
FPKGDIR="/usr/local/fpkg/" # where all packages are located at
44
EDIOR="vim" # change this to your favorite editor
55

6-
VERSION="2.0.0" # not sure why i want a variable for that honestly
6+
VERSION="2.1.0" # not sure why i want a variable for that honestly
77

88
quit () {
99
popd > /dev/null # restore user's working directory
@@ -83,7 +83,13 @@ case $1 in
8383
"install" | "i")
8484
exist_check $2
8585

86-
./ii/$2.ii
86+
./ii/$2.ii install
87+
;;
88+
89+
"remove" | "r")
90+
exist_check $2
91+
92+
./ii/$2.ii remove
8793
;;
8894

8995
"list" | "l")
@@ -95,12 +101,33 @@ case $1 in
95101
"add" | "a")
96102
write_check
97103

98-
exist_check $2
104+
if [[ -z $1 ]]; then
105+
error "package name was not provided!"
106+
fi
99107

100108
stty echo
109+
110+
# add the package to the list
101111
echo $2 >> pkg.list
102-
echo -e "# Writing installation instructions for package $2"\\n > ii/$pkg_name.ii
112+
113+
# write a template for it to make it easier for the user
114+
echo -e "# Installation instructions for package $2"\\n > ii/$2.ii
115+
echo "# Inside install (), write the commands for" >> ii/$2.ii
116+
echo "# installing the package," >> ii/$2.ii
117+
echo "# and inside remove (), write the commands for" >> ii/$2.ii
118+
echo -e "# uninstalling it too."\\n >> ii/$2.ii
119+
120+
echo -e "install () {"\\n\\n"}"\\n >> ii/$2.ii
121+
echo -e "remove () {"\\n\\n"}"\\n >> ii/$2.ii
122+
123+
# this is necessary for being able to call one of the functions when needed
124+
echo "call=\$1; \$call" >> ii/$2.ii
125+
126+
# open up the text editor so that the user can write on
127+
# that template
103128
$EDITOR ii/$2.ii
129+
130+
# finally, make it executable so that fpkg can run it
104131
chmod +x ii/$2.ii
105132
;;
106133

@@ -115,11 +142,12 @@ case $1 in
115142

116143
exist_check $2
117144

118-
export FPKGDIR=$FPKGDIR
119-
export PKG_DIR=$2
120-
sh -c 'cd $FPKGDIR/$PKG_DIR;
121-
echo "Working on $PKG_DIR/, ^D to exit";
122-
exec "${SHELL:-sh}"'
145+
export FPKGDIR # those are necessary to make it able to start the
146+
export PKG_DIR=$2 # shell at the desired directory
147+
148+
sh -c 'cd $FPKGDIR/$PKG_DIR; # change to the directory
149+
echo "Working on $PKG_DIR/, ^D to exit"; # make the user aware of it
150+
exec bash --rcfile $FPKGDIR/.bashrc' # and here it goes
123151
;;
124152

125153
# editing a package's .ii?
@@ -183,6 +211,7 @@ case $1 in
183211
echo "help | h - shows this help message"
184212
echo "update | u - git pull every package listed in pkg.list"
185213
echo "install | i <pkg> - install <pkg> using $FPKGDIR/ii/<pkg>.ii"
214+
echo "remove | r <pkg> - uninstall <pkg> using $FPKGDIR/ii/<pkg>.ii also"
186215
echo "list | l - list registered packages"
187216
echo "add | a <pkg> - register <pkg>"
188217
echo "peek | p <pkg> - take a peek at <pkg>'s .ii"

0 commit comments

Comments
 (0)