Skip to content

Commit d138f88

Browse files
authored
Merge pull request #74 from paritytech/mak/fix-cumulus-paths
Detect the root source & use this as a current local repository
2 parents 578d381 + 23aea5d commit d138f88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

update_substrate_template.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ target_org="substrate-developer-hub"
4545
timestamp=$(date +%Y-%m-%d_%H-%M-%S)
4646
default_branch=main
4747
working_directory="$PWD"
48+
working_repo="$(basename $PWD)"
4849
source_template_path="$working_directory/$template_path"
4950
dest_template_path="$working_directory/$target_repo_name"
5051
template_branch="autoupdate_${polkadot_branch}_${timestamp}"
5152
repo_url_with_token="https://$github_api_token@github.com/$target_org/$target_repo_name.git"
5253

54+
echo "working_repo - $working_repo"
5355
echo "working_directory - $working_directory"
5456
echo "source_template_path - $source_template_path"
5557
echo "dest_template_path - $dest_template_path"
@@ -71,8 +73,8 @@ cd "$dest_template_path"
7173
# stings like 'path = "../../../../frame/system"'
7274
# but avoid "local" dependencies (from parent folder), like 'path = "../runtime"'
7375
query_pattern='path = "\.\.\/\.[^"]*"'
74-
# should be replaced with 'git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26"'
75-
replace_ref="git = \"https:\/\/github.com\/paritytech\/substrate.git\", branch = \"${polkadot_branch}\""
76+
# should be replaced with 'git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.26"' (or cumulus)
77+
replace_ref="git = \"https:\/\/github.com\/paritytech\/$working_repo.git\", branch = \"${polkadot_branch}\""
7678

7779
# find all .toml files and replace relative paths to github repo with polkadot branch
7880
echo "Replacing <$query_pattern> with <$replace_ref> in .toml files"

0 commit comments

Comments
 (0)