-
Notifications
You must be signed in to change notification settings - Fork 21
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
Enhance scripting. #199
Conversation
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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 -
:)
This reverts commit 0056f30.
Closed in favor of #204 |
No description provided.