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

Enhance scripting. #199

Closed
wants to merge 14 commits into from
Closed

Enhance scripting. #199

wants to merge 14 commits into from

Conversation

polina-c
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the type-infra A repository infrastructure change or enhancement label Dec 30, 2023
@github-actions github-actions bot removed the type-infra A repository infrastructure change or enhancement label Dec 30, 2023
tool/analyze.sh Outdated
@@ -9,28 +9,31 @@
# Fast fail the script on failures.
set -ex

sh ./tool/pub_get.sh
# The directory that this script is located in.
TOOL_DIR=`dirname "$0"`

Choose a reason for hiding this comment

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

Suggested change
TOOL_DIR=`dirname "$0"`
TOOL_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

If you get the full path of the script then you can avoid using cd - below.

The same applies to the other files in this change.

Choose a reason for hiding this comment

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

I got that one liner from: https://stackoverflow.com/a/246128

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use tool dir to navigate to other directories in order to run flutter commands from project root. How path to the script will help me?

Choose a reason for hiding this comment

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

it will just make it so you don't have to cd - each time. you can just jump directly to the next directory you are working in, i.e.:

cd $TOOL_DIR/../examples/autosnapshotting
flutter analyze  --fatal-infos

cd $TOOL_DIR/../examples/leak_tracking
flutter analyze --fatal-infos

cd $TOOL_DIR/../pkgs/leak_tracker
dart analyze --fatal-infos

Choose a reason for hiding this comment

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

since it is the full path, there is no need to use the cd - :)

tool/analyze.sh Outdated Show resolved Hide resolved
@polina-c
Copy link
Contributor Author

polina-c commented Jan 9, 2024

Closed in favor of #204

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

Successfully merging this pull request may close these issues.

2 participants