mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
0f15dc05d9
This cleans up the Alacritty scripts a bit by removing some of them which are not recommended to be used anymore and switching from the official FlameGraph tool to the more specialized Rust FlameGraph implementation.
31 lines
836 B
Bash
Executable file
31 lines
836 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# The full path to the script directory, regardless of pwd.
|
|
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# Make sure perf is available.
|
|
if [ ! -x "$(command -v perf)" ]
|
|
then
|
|
echo "Cannot find perf, please make sure it's installed."
|
|
exit 1
|
|
fi
|
|
|
|
# Install cargo-flamegraph
|
|
installed_flamegraph=0
|
|
if [ ! -x "$(command -v cargo-flamegraph)" ]; then
|
|
echo "cargo-flamegraph not installed; installing ..."
|
|
cargo install flamegraph
|
|
installed_flamegraph=1
|
|
fi
|
|
|
|
# Create flamegraph
|
|
cargo flamegraph --bin=alacritty -- $@
|
|
|
|
# Unintall cargo-flamegraph if it has been installed with this script
|
|
if [ $installed_flamegraph == 1 ]; then
|
|
read -p "Would you like to uninstall cargo-flamegraph? [Y/n] " -n 1 -r
|
|
echo
|
|
if [[ "$REPLY" =~ ^[^Nn]*$ ]]; then
|
|
cargo uninstall flamegraph
|
|
fi
|
|
fi
|