-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean-linux.sh
More file actions
27 lines (22 loc) · 991 Bytes
/
Copy pathclean-linux.sh
File metadata and controls
27 lines (22 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
set -euo pipefail
# ------------------------------------------------------------
# OpenCalc Linux cleanup script
#
# Removes Cargo and packaged Linux runtime output while preserving the user
# preference file build-linux/OpenCalc.cfg, matching the Windows clean path.
# ------------------------------------------------------------
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "Cleaning OpenCalc Linux build output..."
rm -rf -- "$SCRIPT_DIR/target"
if [[ -d "$SCRIPT_DIR/build-linux" ]]; then
find "$SCRIPT_DIR/build-linux" -mindepth 1 -maxdepth 1 \
! -name 'OpenCalc.cfg' -exec rm -rf -- {} +
rmdir "$SCRIPT_DIR/build-linux" 2>/dev/null || true
fi
rm -f -- "$SCRIPT_DIR/OpenCalc"
# WSL/Windows downloads can leave NTFS alternate-stream marker files behind
# after a project is copied into the Linux filesystem.
find "$SCRIPT_DIR" -type f -name '*:Zone.Identifier' -delete
echo "Linux build output removed."