Skip to content

Commit e225452

Browse files
Update file names and add extra stuff
Signed-off-by: The-Repo-Club <[email protected]>
1 parent 7018412 commit e225452

File tree

4 files changed

+91
-41
lines changed

4 files changed

+91
-41
lines changed

LICENSE_LMGR

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,15 @@
1717
CAN be redistributed in an open source form
1818
CAN be used privately
1919

20-
2120
This license is non-corporate, individual use only.
2221

2322
The owner of this project holds NO LIABILITY if any unstable, redistributed or modified
2423
versions of this project harms you in any way.
2524

26-
2725
Redistributed or modified versions of this project...
2826
MUST have the same license as the original project
2927
MUST disclose the project's source
3028

31-
3229
OWNER: Ari Archer <[email protected]>
3330
PROJECT NAME: lmgr
3431
YEAR: 2022

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
include config.mk
22

33
all:
4-
@echo Run \'make install\' to install pkmgr.
4+
@echo Run \'make install\' to install proctl.
55

66
install:
77
@mkdir -p $(DESTDIR)$(PREFIX)/bin
88
@mkdir -p $(DESTDIR)$(MANPREFIX)/man1
9-
@sed "s/VERSION/$(VERSION)/g" < pkmgr.1 > $(DESTDIR)$(MANPREFIX)/man1/pkmgr.1
10-
@cp -p pkmgr $(DESTDIR)$(PREFIX)/bin/pkmgr
11-
@chmod 644 $(DESTDIR)$(MANPREFIX)/man1/pkmgr.1
12-
@chmod 755 $(DESTDIR)$(PREFIX)/bin/pkmgr
9+
@sed "s/VERSION/$(VERSION)/g" < proctl.1 > $(DESTDIR)$(MANPREFIX)/man1/proctl.1
10+
@cp -p proctl $(DESTDIR)$(PREFIX)/bin/proctl
11+
@chmod 644 $(DESTDIR)$(MANPREFIX)/man1/proctl.1
12+
@chmod 755 $(DESTDIR)$(PREFIX)/bin/proctl
1313

1414
uninstall:
15-
@rm -rf $(DESTDIR)$(PREFIX)/bin/pkmgr
16-
@rm -rf $(DESTDIR)$(MANPREFIX)/man1/pkmgr.1*
15+
@rm -rf $(DESTDIR)$(PREFIX)/bin/proctl
16+
@rm -rf $(DESTDIR)$(MANPREFIX)/man1/proctl.1*

pkmgr renamed to proctl

Lines changed: 80 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# GitHub - https://github.com/The-Repo-Club/
66
# Author - The-Repo-Club [[email protected]]
77
# Start On - Fri 18 February 2022, 07:26:28 pm (GMT)
8-
# Modified On - Fri 18 February 2022, 07:26:46 pm (GMT)
8+
# Modified On - Sat 19 February 2022, 04:44:59 pm (GMT)
99
# -------------------------------------------------------------------------
1010
#
1111
#
@@ -389,48 +389,101 @@ templating_help() {
389389
} | lless
390390
}
391391

392+
#=== FUNCTION =================================================================
393+
# Name: list_types
394+
# Description: list the types to pass to the template creator
395+
#==============================================================================
396+
397+
list_types() {
398+
printf "language
399+
license"
400+
401+
}
402+
392403
#=== FUNCTION =================================================================
393404
# Name: new_template
394405
# Description: create a new template for language or license
395406
#==============================================================================
396407

397408
new_template() {
398-
printf 'License name/alias (spaces will be removed) -- '
399-
read -r ln
409+
type="$(list_types |
410+
FZF_DEFAULT_OPTS='' fzf --layout=reverse --height=20 --no-mouse -i || echo '')"
400411

401-
[[ -z "$ln" ]] && (
402-
error 'Cannot leave license name empty'
403-
exit 7
404-
)
412+
if [[ "$type" == "license" ]]; then
413+
printf 'License name/alias (spaces will be removed) -- '
414+
read -r ln
405415

406-
ln="$LICENSE_DIR/$(echo "$ln" | tr -d ' ' | head -c250)"
416+
[[ -z "$ln" ]] && (
417+
error 'Cannot leave license name empty'
418+
exit 7
419+
)
407420

408-
if [[ -f "$ln" ]]; then
409-
printf 'This license already exists, do you want to overwrite it? [y/n] '
410-
read -r yn
421+
ln="$LICENSE_DIR/$(echo "$ln" | tr -d ' ' | head -c250)"
411422

412-
[[ "$yn" != 'y' ]] && exit
413-
fi
423+
if [[ -f "$ln" ]]; then
424+
printf 'This license already exists, do you want to overwrite it? [y/n] '
425+
read -r yn
414426

415-
editor="${EDITOR:-}"
427+
[[ "$yn" != 'y' ]] && exit
428+
fi
416429

417-
if [[ -z "$editor" ]]; then
418-
printf 'Editor to open file in -- '
419-
read -r editor
420-
fi
430+
editor="${EDITOR:-}"
421431

422-
[[ -z "$editor" ]] && (
423-
error 'Cannot leave editor empty'
424-
exit 8
425-
)
432+
if [[ -z "$editor" ]]; then
433+
printf 'Editor to open file in -- '
434+
read -r editor
435+
fi
436+
437+
[[ -z "$editor" ]] && (
438+
error 'Cannot leave editor empty'
439+
exit 8
440+
)
426441

427-
depend "$(basename "$editor" | awk '{print $1}')"
442+
depend "$(basename "$editor" | awk '{print $1}')"
428443

429-
set -x
430-
$editor "$ln"
431-
set +x
444+
set -x
445+
$editor "$ln"
446+
set +x
432447

433-
[[ -f "$ln" ]] && einfo "License '$(basename "$ln")' saved"
448+
[[ -f "$ln" ]] && einfo "License '$(basename "$ln")' saved"
449+
elif [[ "$type" == "language" ]]; then
450+
printf 'Language name/alias (spaces will be removed) -- '
451+
read -r ln
452+
453+
[[ -z "$ln" ]] && (
454+
error 'Cannot leave language name empty'
455+
exit 7
456+
)
457+
458+
ln="$LANGUAGE_DIR/$(echo "$ln" | tr -d ' ' | head -c250)"
459+
460+
if [[ -f "$ln" ]]; then
461+
printf 'This language already exists, do you want to overwrite it? [y/n] '
462+
read -r yn
463+
464+
[[ "$yn" != 'y' ]] && exit
465+
fi
466+
467+
editor="${EDITOR:-}"
468+
469+
if [[ -z "$editor" ]]; then
470+
printf 'Editor to open file in -- '
471+
read -r editor
472+
fi
473+
474+
[[ -z "$editor" ]] && (
475+
error 'Cannot leave editor empty'
476+
exit 8
477+
)
478+
479+
depend "$(basename "$editor" | awk '{print $1}')"
480+
481+
set -x
482+
$editor "$ln"
483+
set +x
484+
485+
[[ -f "$ln" ]] && einfo "Language '$(basename "$ln")' saved"
486+
fi
434487
}
435488

436489
#=== FUNCTION =================================================================

pkmgr.1 renamed to proctl.1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
.TH "SHELLFETCH" "1" "VERSION" "SHELLFETCH" "VERSION"
1+
.TH "PROCTL" "1" "VERSION" "PROCTL" "VERSION"
22
.hy
33
.SH NAME
44
.PP
5-
shellfetch \[en] Shell System Information Fetcher
5+
proctl \[en] Github Project Manager
66
.SH SYNOPSIS
77
.PP
8-
\fI\,shellfetch --setcolors [numbers] --file [path/to/file] --source [path/to/file]\/\fR
8+
\fI\,proctl --setcolors [numbers] --file [path/to/file] --source [path/to/file]\/\fR
99
.SH DESCRIPTION
1010
.PP
11-
\f[B]shellfetch\f[R] is a fetch tool that gives system information along with a ascii header.
11+
\f[B]proctl\f[R] is a tool that can manage, switch between templated licenses, and set languages.
1212
.SH GENERAL OPTIONS
1313
.TP
1414
\f[B]-h\f[R], \f[B]\--help\f[R]

0 commit comments

Comments
 (0)