Skip to content

Commit bb32746

Browse files
feat(autocomplete): added bash autocomplete
1 parent 6f39c4a commit bb32746

5 files changed

Lines changed: 40 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [1.1.0] - 2026-03-12
6+
7+
### Added
8+
- **Terminal Autocomplete**: Full Bash completion support is now included in the `.deb` package.
9+
10+
### Fixed
11+
- Resolved a `TypeError` when handling local file installations with certain flags.
12+
13+
## [1.0.1] - 2026-03-11
14+
- Initial stable release with multi-backend support (APT, Snap, Flatpak, Pacstall, am).

DEB_PACKAGING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ The packaging process creates a Python package and packages it into a DEB file t
5050
The resulting DEB package includes:
5151

5252
- **Executable**: `/usr/bin/upk` - The main UPK application
53+
- **Shell Completion**: `/usr/share/bash-completion/completions/upk` - Automatic Bash autocomplete
54+
- **Managed AppImages**: Stored in the location defined by `path_appimages` (default `~/.local/share/applications/AppImages`)
5355
- **Documentation**: `/usr/share/doc/upk/` - Package documentation and license
5456
- **Post-installation script**: Handles setup tasks after installation
5557

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ Enter the number of the package to install (or 'q' to cancel):
4242
**Note**: Backends are automatically disabled if their required command isn't found.
4343

4444
## Installation
45+
Grab the .deb file from [releases](https://github.com/undefinederror/upk/releases). The `.deb` package automatically installs Bash completion.
46+
4547

4648
### Prerequisites
4749
- Python 3.10+
4850
- Ubuntu-based system
4951
- Optional: [Nala](https://gitlab.com/volian/nala) (`sudo apt install nala`) for faster APT operations
5052

51-
### Install UPK
52-
Grab the .deb file from [releases](https://github.com/undefinederror/upk/releases)
53-
```
5453

5554
## Configuration
5655

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1
1+
1.1.0

build.sh

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ EOF
6767
chmod +x "$TEMP_DIR/usr/bin/upk"
6868
print_success "Source files copied and wrapper script created"
6969

70+
# Create bash completion
71+
print_status "Creating bash completion script..."
72+
mkdir -p "$TEMP_DIR/usr/share/bash-completion/completions"
73+
# Set PYTHONPATH to current directory to ensure backends can be imported
74+
export PYTHONPATH=$PYTHONPATH:.
75+
_UPK_COMPLETE=bash_source python3 upk.py > "$TEMP_DIR/usr/share/bash-completion/completions/upk"
76+
print_success "Bash completion script created"
77+
7078
# Create control file from template
7179
print_status "Creating control file from template..."
7280
cp "templates/DEBIAN/control" "$TEMP_DIR/DEBIAN/control"
@@ -83,10 +91,20 @@ print_status "Creating post-removal script from template..."
8391
cp "templates/DEBIAN/postrm" "$TEMP_DIR/DEBIAN/postrm"
8492
chmod 755 "$TEMP_DIR/DEBIAN/postrm"
8593

86-
# Create changelog from template
87-
print_status "Creating changelog from template..."
88-
cp "templates/usr/share/doc/upk/changelog.Debian" "$TEMP_DIR/usr/share/doc/upk/changelog.Debian"
94+
# Create changelog dynamically from CHANGELOG.md
95+
print_status "Generating Debian changelog from CHANGELOG.md..."
96+
# We take the first section of CHANGELOG.md (the latest version) and format it
97+
CHANGELOG_CONTENT=$(grep -Pzn '(?s)## \[\d+\.\d+\.\d+\].*?(?=\n## |$)' CHANGELOG.md | tr -d '\0' | sed '1d' | sed 's/^/ /')
98+
99+
cat > "$TEMP_DIR/usr/share/doc/upk/changelog.Debian" << EOL
100+
upk ($VERSION) unstable; urgency=medium
101+
102+
$CHANGELOG_CONTENT
89103
104+
-- undefinederror <github@object.ninja> $(date -R)
105+
EOL
106+
gzip -n -9 "$TEMP_DIR/usr/share/doc/upk/changelog.Debian"
107+
print_success "Debian changelog generated and compressed"
90108
# Create copyright file from template
91109
print_status "Creating copyright file from template..."
92110
cp "templates/usr/share/doc/upk/copyright" "$TEMP_DIR/usr/share/doc/upk/copyright"

0 commit comments

Comments
 (0)