Last active
May 29, 2021 15:22
-
-
Save hemanth/5ac17136d7fc1693c84b7ed4a3207f6e to your computer and use it in GitHub Desktop.
Build chrome devtools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
function colorPrint { | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
printf "${RED}$*${NC}\n" | |
} | |
function cloneDepTools { | |
colorPrint "Cloning depot_tools" | |
[ ! -d ~/.depot_tools ] && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ~/.depot_tools | |
colorPrint "Done!" | |
export PATH=$PATH:$(realpath ~/.depot_tools) | |
} | |
function fetchDevtools { | |
colorPrint "Fetching devtools" | |
mkdir devtools | |
cd devtools | |
~/.depot_tools/fetch devtools-frontend | |
colorPrint "Done!" | |
} | |
function buildDevTools { | |
colorPrint "Building devtools" | |
cd devtools-frontend | |
~/.depot_tools/gn gen out/Default | |
~/.depot_tools/autoninja -C out/Default | |
colorPrint "Done!" | |
} | |
function openChromeMsg { | |
colorPrint "Opening chrome with the freshly build devtools using the below command: " | |
colorPrint "<path-to-chrome>/chrome --custom-devtools-frontend=file://$(realpath out/Default/gen/front_end)" | |
} | |
# Step 0 | |
cloneDepTools | |
# Step 1 | |
fetchDevtools | |
# Step 2 | |
buildDevTools | |
# Step 3 | |
openChromeMsg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment