dotfiles/.local/bin/scripts/st-unarchive

14 lines
451 B
Bash
Executable File

#!/bin/sh
echo "$1" |
sed 's|\.sync/Archive/\(.\+\)\.[[:digit:]]\+|\1|;
s|\.sync/Archive/||;
s|\.stversions/\(.*\)~[[:digit:]]\+-[[:digit:]]\+|\1|;
s|\.sync-conflict-[[:digit:]]\+-[[:digit:]]\+-[[:alnum:]]\+||'
# TESTING
# echo "1-projects/.sync/Archive/meetings.1.txt
# 1-projects/.sync/Archive/meetings.txt
# data/.stversions/meeting~2020-01
# meeting.sync-conflict-2021-1925-P5K
# meeting.sync-conflict-2021-1925-PRK.txt" |