Skip to content

Commit

Permalink
utils(dep_tree2sql): Update to valid syntax, address shellcheck warni…
Browse files Browse the repository at this point in the history
…ngs (#3547)

* utils(dep_tree2sql): Exit with exit code 1 when changing directory fails

* utils(dep_tree2sql): Use $(...) notation instead of legacy backticked command substitution

* utils(dep_tree2sql): Double quoting some variables

* utils(dep_tree2sql): Drop database only if exists, supported on postgres 9.2 and up (released september 2012)

* utils(dep_tree2sql): Replace fgrep with grep -F

* utils(dep_tree2sql): Double quoting some variables

* utils(dep_tree2sql): Replace egrep with grep -E

* utils(dep_tree2sql): Use read -r to prevent backslash interpretation

* utils(dep_tree2sql): Use 'find .. -print0 | xargs -0 ..' to allow non-alphanumeric filenames

* utils(dep_tree2sql): Replace `find *` with `find ./*`

This has a change in the paths returned, as they start with ./ instead

* utils(dep_tree2sql): Replace find -perm +111 with find -perm /a+x

-perm +mode was deprecated in favor of -perm /mode. It checks if any of the permissions bits in mode is set. It is thus replaced by the equivalent check of "any file that has the executable bit set for anybody"

* utils(dep_tree2sql): Use mapfile to assign libs variable with an array, that can be properly quoted in the call below

* utils(dep_tree2sql): Uniformize shell script formatting

Using `shfmt -w -s -i 4 -ci -bn -sr`

* Convert mixed tab/spaces indentation to spaces only

* utils(dep_tree2sql): Remove temporary directory at end of script
  • Loading branch information
echoix authored Dec 3, 2024
1 parent cf81aad commit cc82d8e
Showing 1 changed file with 252 additions and 249 deletions.
Loading

0 comments on commit cc82d8e

Please sign in to comment.