Skip to content

Instantly share code, notes, and snippets.

@hemanth
Last active May 29, 2021 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemanth/5ac17136d7fc1693c84b7ed4a3207f6e to your computer and use it in GitHub Desktop.
Save hemanth/5ac17136d7fc1693c84b7ed4a3207f6e to your computer and use it in GitHub Desktop.
Build chrome devtools
#!/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