Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: tool/dependency_overrides.sh

Issue 1682673002: Add ./tool/override_analyzer_dependency.sh to checkout latest analyzer + set is as override (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fail on local mods Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .gitignore ('k') | tool/override_analyzer_dependency.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 function add_dependency_override() {
4 local name=$1
5 local path=$2
6 if ! cat pubspec.yaml | grep "dependency_overrides:" ; then
7 echo "dependency_overrides:" >> pubspec.yaml
8 fi
9 local pubspec=`cat pubspec.yaml | grep -v "$name: .path: "`
10 echo "$pubspec" > pubspec.yaml
11 if [[ -n "$path" ]]; then
12 echo " $name: {path: $path}" >> pubspec.yaml
13 fi
14 }
15
16 function checkout_dependency_override_from_github() {
17 local dependency_name=$1
18 local org_project=$2
19 local branch=$3
20 local path=${4:-/}
21
22 local url=https://github.com/$org_project
23
24 echo "dependency_name = $dependency_name"
25 echo "url = $url$path"
26 echo "branch = $branch"
27
28 local dep_dir=dependency_overrides/$dependency_name
29
30 [[ -d `dirname $dep_dir` ]] || mkdir `dirname $dep_dir`
31
32 if [[ -d $dep_dir ]]; then
33 # Check there's no local modifications before removing existing directory.
34 (
35 cd $dep_dir
36 if git status -s | grep . ; then
37 echo "Found local modifications in $dep_dir: aborting"
38 exit 1
39 fi
40 )
41 rm -fR $dep_dir
42 fi
43
44 if [[ "$path" == "/" ]]; then
45 # Checkout only the branch, with no history:
46 git clone --depth 1 --branch $branch $url $dep_dir
47 else
48 (
49 mkdir $dep_dir
50 cd $dep_dir
51
52 # Sparse-checkout only the path + branch, with no history:
53 git init
54 git remote add origin $url
55 git config core.sparsecheckout true
56 echo $path >> .git/info/sparse-checkout
57 git pull --depth=1 origin $branch
58 )
59 fi
60 add_dependency_override $dependency_name $dep_dir$path
61 }
OLDNEW
« no previous file with comments | « .gitignore ('k') | tool/override_analyzer_dependency.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698