Skip to content

Commit c4795d0

Browse files
committed
Remove lastproject on remove_project
1 parent 983d6f1 commit c4795d0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

peg

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,22 @@ function create_project {
326326

327327
function rm_if_exists {
328328
if [ -d "$1" ] ; then
329-
echo Erasing directory $1
329+
echo Erasing directory $1
330330
rm -rf "$1"
331331
else
332332
echo Not removing directory $1 because it does not exist
333333
fi
334334
}
335335

336+
function rm_file_if_exists {
337+
if [ -f "$1" ] ; then
338+
echo Erasing file $1
339+
rm -rf "$1"
340+
else
341+
echo Not removing file $1 because it does not exist
342+
fi
343+
}
344+
336345
function clean_project {
337346
if [ -d "$PGSRC/$PGPROJECT" ] ; then
338347
echo Cleaning out source code tree at $PGSRC/$PGPROJECT
@@ -374,6 +383,8 @@ function remove_project {
374383
rm_if_exists "$PGWORK/$DATADIR/$PGPROJECT"
375384
rm_if_exists "$PGINST/$PGPROJECT"
376385
rm_if_exists "$PGSRC/$PGPROJECT"
386+
rm_file_if_exists "$PGWORK/lastproject"
387+
377388
}
378389

379390
function optional_project {

0 commit comments

Comments
 (0)