|
| 1 | +#! /usr/bin/env bash |
| 2 | + |
| 3 | +#set -x |
| 4 | +set -e |
| 5 | + |
| 6 | +# Find history dirs |
| 7 | +# git log --pretty=format: --name-only | grep -E '^(.archive/)?[^/]+' -o | sort -u | uniq |
| 8 | + |
| 9 | +git clone --bare [email protected]:albertlauncher/python.git .bare || true |
| 10 | + |
| 11 | +function filter ( |
| 12 | + |
| 13 | + if [[ $# -lt 2 ]]; then |
| 14 | + echo "Error: At least two arguments required." |
| 15 | + return 1 |
| 16 | + fi |
| 17 | + |
| 18 | + local repo_name="$(echo $1 | tr '_' '-')" |
| 19 | + local filter_path="$2" |
| 20 | + shift 2 |
| 21 | + |
| 22 | + declare -a additional_filter_paths |
| 23 | + if [[ $# -gt 0 ]]; then |
| 24 | + additional_filter_paths=$(printf -- "--path %s " "$@") |
| 25 | + fi |
| 26 | + |
| 27 | + echo "ℹ️" $repo_name $filter_path $additional_filter_paths |
| 28 | + |
| 29 | + git clone .bare $repo_name |
| 30 | + cd $repo_name |
| 31 | + git filter-repo --subdirectory-filter ${filter_path} ${additional_filter_paths[@]} |
| 32 | + |
| 33 | + gh repo create "albertlauncher/albert-plugin-python-$repo_name" --public --disable-wiki |
| 34 | + git remote add origin "[email protected]:albertlauncher/albert-plugin-python-$repo_name.git" |
| 35 | + git push --set-upstream origin main |
| 36 | + open "https://github.com/albertlauncher/albert-plugin-python-$repo_name" |
| 37 | + |
| 38 | + cd .. |
| 39 | +) |
| 40 | + |
| 41 | + |
| 42 | +#filter arch_wiki arch_wiki .archive/arch_wiki ArchWiki |
| 43 | +filter atom_projects atom_projects atom_projects.py .archive/atom_projects AtomProjects.py |
| 44 | +filter aur aur .archive/aur AUR |
| 45 | +filter base_converter base_converter base_converter.py .archive/base_converter BaseConverter.py |
| 46 | +filter binance binance .archive/binance Binance |
| 47 | +filter bitfinex bitfinex .archive/bitfinex Bitfinex |
| 48 | +filter bitwarden bitwarden bitwarden.py .archive/bitwarden |
| 49 | +filter coingecko coingecko |
| 50 | +filter coinmarketcap coinmarketcap .archive/coinmarketcap CoinMarketCap |
| 51 | +filter color color |
| 52 | +filter copyq copyq copyq.py .archive/copyq CopyQ.py |
| 53 | +filter currency_converter currency_converter currency_converter.py .archive/currency_converter Currency.py |
| 54 | +filter dango_emoji dango_emoji .archive/dango_emoji dangoemoji |
| 55 | +filter dango_kao dango_kao .archive/dango_kao dangokao |
| 56 | +filter datetime datetime datetime.py .archive/datetime DateTime.py epoch Epoch.py |
| 57 | +filter dice_roll dice_roll .archive/dice_roll |
| 58 | +filter docker docker .archive/docker |
| 59 | +filter duckduckgo duckduckgo |
| 60 | +filter emoji emoji EmojiPicker unicode_emoji .archive/unicode_emoji |
| 61 | +filter find find find .archive/find |
| 62 | +filter fortune fortune fortune.py .archive/fortune Fortune.py |
| 63 | +filter gnome_dictionary gnome_dictionary gnome_dictionary.py .archive/gnome_dictionary GnomeDictionary.py |
| 64 | +filter gnote gnote gnote.py .archive/gnote Gnote.py |
| 65 | +filter goldendict goldendict goldendict.py .archive/goldendict GoldenDict.py |
| 66 | +filter google_translate google_translate google_translate.py .archive/google_translate GoogleTranslate.py |
| 67 | +filter googletrans googletrans .archive/googletrans |
| 68 | +filter inhibit_sleep inhibit_sleep .archive/inhibit_sleep |
| 69 | +filter ip ip ip.py .archive/ip Ip.py |
| 70 | +filter jetbrains_projects jetbrains_projects jetbrains-projects.py .archive/jetbrains_projects JetbrainsProjects |
| 71 | +filter kill kill kill.py .archive/kill Kill.py |
| 72 | +filter locate locate locate.py .archive/locate Locate.py |
| 73 | +filter lpass lpass .archive/lpass |
| 74 | +filter mathematica_eval mathematica_eval mathematica_eval.py .archive/mathematica_eval |
| 75 | +filter multi_google_translate multi_google_translate multi_google_translate.py .archive/multi_google_translate MultiGoogleTranslate.py |
| 76 | +filter node_eval node_eval .archive/node_eval |
| 77 | +filter npm npm .archive/npm Npm |
| 78 | +filter packagist packagist .archive/packagist Packagist |
| 79 | +filter pacman pacman pacman.py .archive/pacman Pacman.py |
| 80 | +filter pass pass pass.py .archive/pass Pass.py |
| 81 | +filter php_eval php_eval .archive/php_eval |
| 82 | +filter pidgin pidgin pidgin.py .archive/pidgin Pidgin.py |
| 83 | +filter pomodoro pomodoro .archive/pomodoro Pomodoro |
| 84 | +filter python_eval python_eval python Python |
| 85 | +filter rand rand .archive/rand |
| 86 | +filter scrot scrot scrot.py Scrot.py .archive/scrot |
| 87 | +filter syncthing syncthing |
| 88 | +filter tex_to_unicode tex_to_unicode tex_to_unicode.py .archive/tex_to_unicode .archive/texdoc |
| 89 | +filter texdoc texdoc |
| 90 | +filter timer timer Timer .archive/timer |
| 91 | +filter tomboy tomboy tomboy.py Tomboy.py .archive/tomboy |
| 92 | +filter translators translators |
| 93 | +filter trash trash trash.py Trash.py .archive/trash |
| 94 | +filter unit_converter unit_converter .archive/unit_converter |
| 95 | +filter units units units.py Units.py .archive/units |
| 96 | +filter virtualbox virtualbox virtualbox.py VirtualBox.py .archive/virtualbox |
| 97 | +filter vpn vpn vpn.py .archive/vpn |
| 98 | +filter vscode_projects vscode_projects |
| 99 | +filter wikipedia wikipedia Wikipedia Wikipedia.py |
| 100 | +filter x_window_switcher x_window_switcher window_switcher window_switcher.py WindowSwitcher.py SwitchApp.py .archive/window_switcher |
| 101 | +filter xkcd xkcd .archive/xkcd |
| 102 | +filter youtube youtube youtube.py Youtube.py .archive/youtube |
| 103 | +filter zeal zeal zeal.py Zeal.py .archive/zeal |
| 104 | + |
| 105 | + |
| 106 | + |
0 commit comments