Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ban ls command #1141

Merged
merged 5 commits into from
Dec 29, 2021
Merged

fix: Ban ls command #1141

merged 5 commits into from
Dec 29, 2021

Conversation

Stratus3D
Copy link
Member

Summary

ls should be banned because it's seldom the right tool for the job. Often plain old shell globbing, or find are more reliable ways of listing directories.

  • Only grep sh/bash files for banned commands
  • Ban ls command
  • Replace instances of ls with find

Related: #1100 #1029

Fixes: Uncertain whether this will fix any outstanding issues.

@Stratus3D Stratus3D requested a review from a team as a code owner December 28, 2021 23:04
@Stratus3D Stratus3D changed the title Ban ls command fix: Ban ls command Dec 28, 2021
@@ -454,7 +454,7 @@ resolve_symlink() {
# This seems to be the only cross-platform way to resolve symlink paths to
# the real file path.
# shellcheck disable=SC2012
resolved_path=$(ls -l "$symlink" | sed -e 's|.*-> \(.*\)|\1|')
resolved_path=$(ls -l "$symlink" | sed -e 's|.*-> \(.*\)|\1|') # asdf_allow: ls '
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not yet found a better cross-platform solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant