]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/commitdiff
Merge pull request #264 from Midblyte/main
authorb3nj5m1n <47924309+b3nj5m1n@users.noreply.github.com>
Thu, 28 Sep 2023 12:26:34 +0000 (14:26 +0200)
committerGitHub <noreply@github.com>
Thu, 28 Sep 2023 12:26:34 +0000 (14:26 +0200)
29 files changed:
README.md
flake.nix
programs/R.json [new file with mode: 0644]
programs/android-studio.json [deleted file]
programs/android.json [new file with mode: 0644]
programs/ansible.json
programs/antigen.json [new file with mode: 0644]
programs/aria2.json
programs/cups.json
programs/davfs2.json [new file with mode: 0644]
programs/easyocr [new file with mode: 0644]
programs/fennel.json [new file with mode: 0644]
programs/gdb.json
programs/gore.json [new file with mode: 0644]
programs/guile.json [new file with mode: 0644]
programs/influx-cli.json [new file with mode: 0644]
programs/john.json [new file with mode: 0644]
programs/minetest.json [new file with mode: 0644]
programs/openjdk.json
programs/pciutils.json [new file with mode: 0644]
programs/pinfo.json [new file with mode: 0644]
programs/psensor.json [new file with mode: 0644]
programs/rstudio.json [deleted file]
programs/scilab.json [new file with mode: 0644]
programs/vim.json
programs/xinit.json
programs/xorg-xrdb.json
programs/zap-proxy.json [new file with mode: 0644]
xdg-ninja.sh

index 4e132016b884306eb58341bac3f52aebc5ef2ec0..9af8c772bbc41e40a5b95afc89b7fd97b9fbef0e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
 A shell script which checks your _$HOME_ for unwanted files and directories.
 
 <p align="center">
-  <img src="https://s8.gifyu.com/images/Peek-2022-05-13-16-07.gif" width="500"/>
+  <img src="https://s11.gifyu.com/images/68747470733a2f2f73382e67696679752e636f6d2f696d616765732f5065656b2d323032322d30352d31332d31362d30372e676966.gif" width="500"/>
 </p>
 
 When it encounters a file it knows about, it will tell you whether it's possible to move this file to an appropriate location, and how to do it.
@@ -36,6 +36,7 @@ To install xdg-ninja with [Homebrew](https://brew.sh), run `brew install xdg-nin
 
 - your favorite POSIX-compliant shell ([bash](https://repology.org/project/bash/packages), [zsh](https://repology.org/project/zsh/packages), [dash](https://repology.org/project/dash-shell/packages), ...)
 - [jq](https://repology.org/project/jq/packages) for parsing the json files
+- [find](https://repology.org/project/findutils/versions)
 
 ### Optional
 
index 8f3a5bfc2d03554273839c201236510173a28de8..5a1be2c21cce6fd7a1c971081d85a72352726eba 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -13,6 +13,7 @@
         runtimeDependencies = with pkgs; [
           glow
           jq
+          findutils
         ];
         overlays = [
           (self: super: {
diff --git a/programs/R.json b/programs/R.json
new file mode 100644 (file)
index 0000000..4fdf768
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "R",
+    "files": [
+        {
+            "path": "$HOME/R",
+            "movable": true,
+            "help": "Set R_LIBS_USER in `$HOME/.Renviron:\n\n```\nR_LIBS_USER=\"$XDG_DATA_HOME\"/R/x86_64-pc-linux-gnu-library\n```\n\nYou may find it necessary to append this line to the end of `/usr/lib/R/library/base/R/Rprofile`:\n\n```R.libPaths( c( \"$XDG_DATA_HOME/R/x86_64-pc-linux-gnu-library/\" , .libPaths() ) )```\n\n**Disclaimer: You may need to re-install your libraries**"
+        }
+    ]
+}
diff --git a/programs/android-studio.json b/programs/android-studio.json
deleted file mode 100644 (file)
index ce08850..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "files": [
-        {
-            "help": "Try exporting the following environment variables:\n\n```bash\nexport ANDROID_HOME=\"$XDG_DATA_HOME\"/android\n```\n\n**adb** will always generate \"$HOME/.android/adbkeys\".\n",
-            "movable": false,
-            "path": "$HOME/.android"
-        }
-    ],
-    "name": "android-studio"
-}
\ No newline at end of file
diff --git a/programs/android.json b/programs/android.json
new file mode 100644 (file)
index 0000000..4d3273e
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "files": [
+        {
+            "help": "Export the following environment variable:\n\n```bash\nexport ANDROID_HOME=\"$XDG_DATA_HOME\"/android\n```\n\nAdditionally, if you use adb, use the following alias:\n\n```bash\nalias adb='HOME=\"$XDG_DATA_HOME\"/android adb'\n```\n\n",
+            "movable": true,
+            "path": "$HOME/.android"
+        }
+    ],
+    "name": "android"
+}
index 076a76ac11695ebb9c97d21d55ca2e77c28b4606..dba6da959add111f5df273d3ffbaf5a46f27bba8 100644 (file)
@@ -2,8 +2,8 @@
     "files": [
         {
             "path": "$HOME/.ansible",
-            "movable": false,
-            "help": "See [this](https://github.com/ansible/ansible/commit/d7fbde4ea9db6cc44e81c39d699595330f4fa3c6) pull request.\n\nSeems to be implemented now, you should be able to set the _ANSIBLE_HOME_ environment variable.\n\nI couldn't get it to work yet unfortunately, and you might need to wait for a new release.\n"
+            "movable": true,
+            "help": "Export the following environment variables:\n\n```bash\nexport ANSIBLE_HOME=\"$XDG_DATA_HOME\"/ansible\n```\n"
         }
     ],
     "name": "ansible"
diff --git a/programs/antigen.json b/programs/antigen.json
new file mode 100644 (file)
index 0000000..736a3c1
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "files": [
+    {
+      "path": "$HOME/.antigen",
+      "movable": true,
+      "help": "Export the following environmental variable:\n\n```bash\nexport ADOTDIR=\"$XDG_DATA_HOME\"/antigen\n```\n\n_Note: do_ **not** _move the pre-existing antigen folder from $HOME/.antigen to the new location because it would make antigen crash (the reason is antigen hardcodes the \"$HOME/.antigen\" directory in the `init.zsh` file upon installation of the bundle), simply_ **remove** _\"$HOME/.antigen\" and the next time you will spawn an instance of zsh, antigen will install all the plugins correctly in the new location (and hardcode the new, correct, location)._\n"
+    }
+  ],
+  "name": "antigen"
+}
index 1cb22482232c0e73aaf7bc5c824a03c6c2d85c08..998873cdd5556ee07186f61ff03f11bb3e2690f2 100644 (file)
@@ -7,9 +7,9 @@
             "help": "Supported\n\nThe file $HOME/.aria2/dht.dat can be moved to $XDG_CACHE_HOME/aria2/dht.dat.\n"
         },
         {
-            "path": "$HOME/.aria2/aria.conf",
+            "path": "$HOME/.aria2/aria2.conf",
             "movable": true,
-            "help": "Supported\n\nThe file $HOME/.aria2/aria.conf can be moved to $XDG_CONFIG_HOME/aria2/aria2.conf.\n"
+            "help": "Supported\n\nThe file $HOME/.aria2/aria2.conf can be moved to $XDG_CONFIG_HOME/aria2/aria2.conf.\n"
         }
     ]
 }
index 5620087ddf6fe96c0314dc4ceb20c1ceac17adde..c947d2488e7dfd41fe4ab36075f6cb3cb2b51a04 100644 (file)
@@ -1,10 +1,10 @@
 {
-    "name": "CUPS",
-    "files": [
-        {
-            "path": "$HOME/.cups",
-           "movable": false,
-           "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/OpenPrinting/cups/issues/10\n"
-        }
-    ]
+  "name": "CUPS",
+  "files": [
+    {
+      "path": "$HOME/.cups",
+      "movable": true,
+      "help": "Supported.\n\nThe file $HOME/.cups can be moved to $XDG_CONFIG_HOME/cups.\n\n_Relevant issue:_ https://github.com/OpenPrinting/cups/issues/10\n"
+    }
+  ]
 }
diff --git a/programs/davfs2.json b/programs/davfs2.json
new file mode 100644 (file)
index 0000000..16687f6
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "davfs2",
+    "files": [
+        {
+            "path": "$HOME/.davfs2",
+            "movable": false,
+            "help": "Currently unsupported.\n\n_Relevant issue:_ https://savannah.nongnu.org/support/?110249\n"
+        }
+    ]
+}
diff --git a/programs/easyocr b/programs/easyocr
new file mode 100644 (file)
index 0000000..e1cbebb
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "easyocr",
+    "files": [
+        {
+            "path": "$HOME/.EasyOCR",
+            "movable": true,
+            "help": "Export the following environment variable:\n\n```bash\nexport EASYOCR_MODULE_PATH=\"$XDG_CONFIG_HOME/EasyOCR\"\n```\n"
+        }
+    ]
+}
diff --git a/programs/fennel.json b/programs/fennel.json
new file mode 100644 (file)
index 0000000..01a0ee4
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "fennel",
+    "files": [
+        {
+            "path": "$HOME/.fennelrc",
+            "movable": true,
+            "help": "Supported since _v0.3.1_.\n\nYou can move the file to _$XDG_CONFIG_HOME/fennel/fennelrc_.\n"
+        }
+    ]
+}
index 0f066a8948d92f4246fdb80de3ebf35267fed091..d9121d27a6393bccc193bbae1659ec7ca81e4a0d 100644 (file)
@@ -4,7 +4,7 @@
         {
             "path": "$HOME/.gdbinit",
             "movable": true,
-            "help": "Alias gdb to use custom locations:\n\n```bash\nalias gdb=gdb -n -x $XDG_CONFIG_HOME/gdb/init```\n"
+            "help": "XDG is supported out-of-the-box, so you can simply move the file to _$XDG_CONFIG_HOME/gdb/gdbinit_.\n"
         },
         {
             "path": "$HOME/.gdb_history",
diff --git a/programs/gore.json b/programs/gore.json
new file mode 100644 (file)
index 0000000..749bc29
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "files": [
+        {
+            "path": "$HOME/.gore",
+            "movable": true,
+            "help": "Export the following environment variables:\n\n```bash\nexport GORE_HOME=\"$XDG_DATA_HOME/gore\"\n```\n"
+        }
+    ],
+    "name": "gore"
+}
\ No newline at end of file
diff --git a/programs/guile.json b/programs/guile.json
new file mode 100644 (file)
index 0000000..80bdad3
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "files": [
+        {
+            "path": "$HOME/.guile_history",
+            "movable": true,
+            "help": "Export the following environment variable:\n\n```bash\nexport GUILE_HISTORY=\"$XDG_STATE_HOME\"/guile_history\n```\n"
+        }
+    ],
+    "name": "guile"
+}
diff --git a/programs/influx-cli.json b/programs/influx-cli.json
new file mode 100644 (file)
index 0000000..d76f312
--- /dev/null
@@ -0,0 +1,11 @@
+
+{
+    "name": "influx-cli",
+    "files": [
+        {
+            "path": "$HOME/.influx_history",
+            "movable": false,
+            "help": "Currently unsupported\n\n _Relevant issue:_ https://github.com/influxdata/influx-cli/issues/514"
+        }
+    ]
+}
diff --git a/programs/john.json b/programs/john.json
new file mode 100644 (file)
index 0000000..5e3e1e5
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "john",
+    "files": [
+        {
+            "path": "$HOME/.john",
+            "movable": false,
+            "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/openwall/john/issues/4552\n"
+        }
+    ]
+}
diff --git a/programs/minetest.json b/programs/minetest.json
new file mode 100644 (file)
index 0000000..72c794f
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "minetest",
+    "files": [
+        {
+            "path": "$HOME/.minetest",
+            "movable": true,
+            "help": "Export the following environment variables:\n\n```bash\nexport MINETEST_USER_PATH=\"$XDG_DATA_HOME\"/minetest\n```\n"
+        }
+    ]
+}
index b40319c0dba41f4e47a76e9fe88071b3ad3826e7..2a031d0f688710c567423260a3dc450744e949ba 100644 (file)
@@ -3,7 +3,7 @@
         {
             "path": "$HOME/.java",
             "movable": false,
-            "help": "**Disclaimer: some applications don't respect this setting.**\n\nExport the following environment variable:\n\n```bash\nexport _JAVA_OPTIONS=-Djava.util.prefs.userRoot=\"$XDG_CONFIG_HOME\"/java\n```\n\nSee [ticket](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8290140)"
+            "help": "**Disclaimer: some applications don't respect this setting.**\n\nExport the following environment variable:\n\n```bash\nexport _JAVA_OPTIONS=-Djava.util.prefs.userRoot=\"$XDG_CONFIG_HOME\"/java\n```\n\nSee [ticket](https://bugs.java.com/bugdatabase/view_bug?bug_id=8290140)"
         }
     ],
     "name": "openjdk"
diff --git a/programs/pciutils.json b/programs/pciutils.json
new file mode 100644 (file)
index 0000000..bcd8957
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "pciutils",
+    "files": [
+        {
+            "path": "$HOME/.pciids-cache",
+            "movable": false,
+            "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/pciutils/pciutils/issues/148\n"
+        }
+    ]
+}
diff --git a/programs/pinfo.json b/programs/pinfo.json
new file mode 100644 (file)
index 0000000..ff2eb2c
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "files": [
+    {
+      "help": "Move .pinforc to $XDG_CONFIG_HOME/pinfo/pinforc\nand set this alias in your shell\n\nalias pinfo='pinfo --rcfile=$HOME/.config/pinfo/pinforc'\n",
+      "movable": true,
+      "path": "$HOME/.pinforc"
+    }
+  ],
+  "name": "pinfo"
+}
diff --git a/programs/psensor.json b/programs/psensor.json
new file mode 100644 (file)
index 0000000..03cbdc2
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "name": "psensor",
+    "files": [
+        {
+            "path": "$HOME/.psensor",
+            "movable": false,
+            "help": "Currently unsupported.\n\n_Relevant patch:_ https://gitlab.com/jeanfi/psensor/-/merge_requests/27\n"
+        }
+    ]
+}
diff --git a/programs/rstudio.json b/programs/rstudio.json
deleted file mode 100644 (file)
index 3b96acf..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "name": "rstudio",
-    "files": [
-        {
-            "path": "$HOME/R",
-            "movable": true,
-            "help": "Default directory location can be configured in RStudio\nReference: https://www.accelebrate.com/library/how-to-articles/r-rstudio-library"
-        }
-    ]
-}
diff --git a/programs/scilab.json b/programs/scilab.json
new file mode 100644 (file)
index 0000000..f048388
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "files": [
+        {
+            "path": "$HOME/.Scilab",
+            "movable": true,
+            "help": "Export the following environment variable:\n\n```bash\nexport SCIHOME=\"$XDG_STATE_HOME\"/scilab\n```\n"
+        }
+    ],
+    "name": "scilab"
+}
index f6f20ff79a846fc869398f86386d23af8b92537a..5d9475a027f83f7bff56b916fdeafb219317b1f9 100644 (file)
@@ -1,7 +1,7 @@
 {
     "files": [
         {
-            "help": "Since 7.3.1178 vim will search for ~/.vim/vimrc if ~/.vimrc is not found.\n\n\"$XDG_CONFIG_HOME\"/vim/vimrc\n```vim\nset runtimepath^=$XDG_CONFIG_HOME/vim\nset runtimepath+=$XDG_DATA_HOME/vim\nset runtimepath+=$XDG_CONFIG_HOME/vim/after\n\nset packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim\nset packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after\n\nlet g:netrw_home = $XDG_DATA_HOME.\"/vim\"\ncall mkdir($XDG_DATA_HOME.\"/vim/spell\", 'p')\n\nset backupdir=$XDG_STATE_HOME/vim/backup | call mkdir(&backupdir, 'p')\nset directory=$XDG_STATE_HOME/vim/swap   | call mkdir(&directory, 'p')\nset undodir=$XDG_STATE_HOME/vim/undo     | call mkdir(&undodir,   'p')\nset viewdir=$XDG_STATE_HOME/vim/view     | call mkdir(&viewdir,   'p')\n\nif !has('nvim') | set viminfofile=$XDG_STATE_HOME/vim/viminfo | endif\n```\n\n~/.profile\n```\nexport GVIMINIT='let $MYGVIMRC=\"$XDG_CONFIG_HOME/vim/gvimrc\" | source $MYGVIMRC'\nexport VIMINIT='let $MYVIMRC=\"$XDG_CONFIG_HOME/vim/vimrc\" | source $MYVIMRC'\n```\n[G]VIMINIT environment variable will also affect Neovim. If separate configs for Vim and Neovim are desired then the following will be a better choice:\n\n```\nexport GVIMINIT='let $MYGVIMRC = !has(\"nvim\") ? \"$XDG_CONFIG_HOME/vim/gvimrc\" : \"$XDG_CONFIG_HOME/nvim/init.gvim\" | so $MYGVIMRC'\nexport VIMINIT='let $MYVIMRC = !has(\"nvim\") ? \"$XDG_CONFIG_HOME/vim/vimrc\" : \"$XDG_CONFIG_HOME/nvim/init.vim\" | so $MYVIMRC'\n```\n\nAdditional information:\nhttps://blog.joren.ga/vim-xdg\nhttps://tlvince.com/vim-respect-xdg\n",
+            "help": "Since 7.3.1178 vim will search for ~/.vim/vimrc if ~/.vimrc is not found.\n\n\"$XDG_CONFIG_HOME\"/vim/vimrc\n```vim\nset runtimepath^=$XDG_CONFIG_HOME/vim\nset runtimepath+=$XDG_DATA_HOME/vim\nset runtimepath+=$XDG_CONFIG_HOME/vim/after\n\nset packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim\nset packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after\n\nlet g:netrw_home = $XDG_DATA_HOME.\"/vim\"\ncall mkdir($XDG_DATA_HOME.\"/vim/spell\", 'p')\n\nset backupdir=$XDG_STATE_HOME/vim/backup | call mkdir(&backupdir, 'p')\nset directory=$XDG_STATE_HOME/vim/swap   | call mkdir(&directory, 'p')\nset undodir=$XDG_STATE_HOME/vim/undo     | call mkdir(&undodir,   'p')\nset viewdir=$XDG_STATE_HOME/vim/view     | call mkdir(&viewdir,   'p')\n\nif !has('nvim') | set viminfofile=$XDG_STATE_HOME/vim/viminfo | endif\n```\n\n~/.profile\n```\nexport GVIMINIT='let $MYGVIMRC=\"$XDG_CONFIG_HOME/vim/gvimrc\" | source $MYGVIMRC'\nexport VIMINIT='let $MYVIMRC=\"$XDG_CONFIG_HOME/vim/vimrc\" | source $MYVIMRC'\n```\n[G]VIMINIT environment variable will also affect Neovim. If separate configs for Vim and Neovim are desired then the following will be a better choice:\n\n```\nexport GVIMINIT='let $MYGVIMRC = !has(\"nvim\") ? \"$XDG_CONFIG_HOME/vim/gvimrc\" : \"$XDG_CONFIG_HOME/nvim/init.gvim\" | so $MYGVIMRC'\nexport VIMINIT='let $MYVIMRC = !has(\"nvim\") ? \"$XDG_CONFIG_HOME/vim/vimrc\" : \"$XDG_CONFIG_HOME/nvim/init.vim\" | so $MYVIMRC'\n```\n\nAdditional information:\nhttps://jorengarenar.github.io/blog/vim-xdg\nhttps://tlvince.com/vim-respect-xdg\n",
             "movable": true,
             "path": "$HOME/.vimrc"
         },
@@ -17,4 +17,4 @@
         }
     ],
     "name": "vim"
-}
\ No newline at end of file
+}
index 2ee1e630b7d483309ccda4f46911e04ed986d08e..fd0cf68189325a9f8cec4c65915ad921face7bf5 100644 (file)
@@ -2,14 +2,14 @@
     "files": [
         {
             "help": "Export the following environment variable:\n\n```bash\nexport XSERVERRC=\"$XDG_CONFIG_HOME\"/X11/xserverrc\n```\n",
-            "movable": false,
+            "movable": true,
             "path": "$HOME/.xserverrc"
         },
         {
             "help": "Export the following environment variable:\n\n```bash\nexport XINITRC=\"$XDG_CONFIG_HOME\"/X11/xinitrc\n```\n",
-            "movable": false,
+            "movable": true,
             "path": "$HOME/.xinitrc"
         }
     ],
     "name": "xinit"
-}
\ No newline at end of file
+}
index 63c29d2fdb38c9af23b54569694f7f0ea164981b..14dacf919561579c75cf228382ea83ecb15a863b 100644 (file)
@@ -4,6 +4,11 @@
             "path": "$HOME/.Xresources",
             "movable": true,
             "help": "xrdb loads these resources, wherever you call xrdb, add this flag:\n\n```bash\nxrdb -load \"$XDG_CONFIG_HOME/X11/xresources\"\n```\n\n_Note: It will probably be called by your Xsession file._\n"
+        },
+        {
+            "path": "$HOME/.Xdefaults",
+            "movable": true,
+            "help": "Old version of .Xresources. xrdb loads these resources, wherever you call xrdb, add this flag:\n\n```bash\nxrdb -load \"$XDG_CONFIG_HOME/X11/xresources\"\n```\n\n_Note: It will probably be called by your Xsession file._\n"
         }
     ],
     "name": "xorg-xrdb"
diff --git a/programs/zap-proxy.json b/programs/zap-proxy.json
new file mode 100644 (file)
index 0000000..a3d6044
--- /dev/null
@@ -0,0 +1,11 @@
+{
+    "name": "ZAP Proxy",
+    "files": [
+        {
+            "path": "$HOME/.ZAP",
+            "movable": false,
+            "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/zaproxy/zaproxy/issues/7718"
+        }
+    ]
+}
+
index 8780de7a2e26f4880ac30e4d15749b7e3a2f4c43..84260f5498973d2a1b502f3147cb8c04eb396ef4 100755 (executable)
@@ -123,14 +123,32 @@ apply_shell_expansion() {
     eval "$command"
 }
 
-# Returns 0 if the path doesn't lead anywhere
-# Returns 1 if the path leads to something
-check_if_file_exists() {
-    FILE_PATH=$(apply_shell_expansion "$1")
-    if [ -e "$FILE_PATH" ]; then
+# Function to check if a string contains shell pattern matching
+has_pattern() {
+    case $1 in
+    *\** | *\?* | *\[*\]*)
+        return 0
+        ;;
+    *)
         return 1
+        ;;
+    esac
+}
+
+# Returns the actual name of the given file that is on the user's disk
+# This command applies shell pattern matching and return the actual filename
+retrieve_existing_filename() {
+    FILE_PATH=$(apply_shell_expansion "$1")
+
+    # return filename if found, nothing else
+    if has_pattern "$FILE_PATH"; then
+        dir="$(dirname "$FILE_PATH")"
+        part="$(basename "$FILE_PATH")"
+        find "$dir" -maxdepth 1 -name "$part" -print -quit 2>/dev/null
     else
-        return 0
+        if [ -e "$FILE_PATH" ]; then
+            printf "%s" "$FILE_PATH"
+        fi
     fi
 }
 
@@ -186,30 +204,24 @@ check_file() {
     MOVABLE="$3"
     HELP="$4"
 
-    check_if_file_exists "$FILENAME"
-
-    case $? in
+    file=$(retrieve_existing_filename "$FILENAME")
 
-    0)
-        log SUCS "$NAME" "$FILENAME" "$HELP"
-        ;;
-
-    1)
+    if [ "$file" ]; then
         if [ "$MOVABLE" = true ]; then
-            log ERR "$NAME" "$FILENAME" "$HELP"
+            log ERR "$NAME" "$file" "$HELP"
         else
-            log WARN "$NAME" "$FILENAME" "$HELP"
+            log WARN "$NAME" "$file" "$HELP"
         fi
         if [ "$HELP" ]; then
             if [ "$MOVABLE" = true ] || [ "$SKIP_UNSUPPORTED" = false ]; then
-                log HELP "$NAME" "$FILENAME" "$HELP"
+                log HELP "$NAME" "$file" "$HELP"
             fi
         else
-            log HELP "$NAME" "$FILENAME" "_No help available._"
+            log HELP "$NAME" "$file" "_No help available._"
         fi
-        ;;
-
-    esac
+    else
+        log SUCS "$NAME" "$file" "$HELP"
+    fi
 }
 
 # Reads files from programs/, calls check_file on each file specified for each program