Skip to content

Instantly share code, notes, and snippets.

@jpwilliams
Last active August 7, 2023 20:57

Revisions

  1. jpwilliams revised this gist Aug 15, 2017. 2 changed files with 3 additions and 3 deletions.
    4 changes: 2 additions & 2 deletions tree.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Uses `tree` along with a `.gitignore` file to filter results. Defaults to ignoring `node_modules` if no `.gitignore` can be found in the current directory.
    Uses `tree` along with a `.gitignore` file to filter results. Defaults to ignoring `node_modules` if no `.gitignore` can be found in the current directory or in the git repo's root directory.

    Would be nice if it used all relevant `.gitignore` files rather than just the one in the current directory. Even nicer if the output showed the status of files in Git (modified, unchanged, new, deleted etc).
    Would be cooler if we knew exacty where `.gitignore` files made a difference. Even nicer if the output showed the status of files in Git (modified, unchanged, new, deleted etc).

    Package?
    2 changes: 1 addition & 1 deletion tree.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    tree -C -I $((cat .gitignore 2> /dev/null || echo "node_modules") | egrep -v "^#.*$|^[[:space:]]*$" | tr "\\n" "|" | rev | cut -c 2- | rev)
    tree -C -I $((cat .gitignore 2> /dev/null || cat $(git rev-parse --show-toplevel 2> /dev/null)/.gitignore 2> /dev/null || echo "node_modules") | egrep -v "^#.*$|^[[:space:]]*$" | tr "\\n" "|" | rev | cut -c 2- | rev)
  2. jpwilliams revised this gist Aug 14, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion tree.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    Uses `tree` along with a `.gitignore` file to filter results. Defaults to ignoring `node_modules` if no `.gitignore` can be found in the current directory.

    Would be nice if it used all relevant `.gitignore` files rather than just the one in the current directory.
    Would be nice if it used all relevant `.gitignore` files rather than just the one in the current directory. Even nicer if the output showed the status of files in Git (modified, unchanged, new, deleted etc).

    Package?
  3. jpwilliams revised this gist Aug 14, 2017. No changes.
  4. jpwilliams revised this gist Aug 14, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tree.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    Uses `tree` along with a `.gitignore` file to filter results.
    Uses `tree` along with a `.gitignore` file to filter results. Defaults to ignoring `node_modules` if no `.gitignore` can be found in the current directory.

    Defaults to ignoring `node_modules` if no `.gitignore` can be found in the current directory.
    Would be nice if it used all relevant `.gitignore` files rather than just the one in the current directory.
  5. jpwilliams revised this gist Aug 14, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions tree.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    Uses `tree` along with a `.gitignore` file to filter results.

    Defaults to ignoring `node_modules` if no `.gitignore` can be found in the current directory.
  6. jpwilliams created this gist Aug 14, 2017.
    1 change: 1 addition & 0 deletions tree.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    tree -C -I $((cat .gitignore 2> /dev/null || echo "node_modules") | egrep -v "^#.*$|^[[:space:]]*$" | tr "\\n" "|" | rev | cut -c 2- | rev)