Mercurial > self-hosted
annotate Mercurial/CreathgRepos.sh @ 4:4977c0f8b002
回退的修订集: 8e515a52c7a9
| author | Franklin Schmit <meokcin@gmail.com> |
|---|---|
| date | Wed, 04 Sep 2024 07:57:43 +0800 |
| parents | 44d6d3cb28a0 |
| children |
| rev | line source |
|---|---|
| 0 | 1 #!/bin/bash |
| 2 | |
|
1
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
3 echo "Please enter the repository name (not in Chinese):" |
| 0 | 4 read repo_name |
| 5 | |
| 6 repo_path="/var/hg/$repo_name" | |
| 7 mkdir -p "$repo_path" | |
| 8 | |
| 9 if [ ! -d "$repo_path" ]; then | |
|
1
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
10 echo "Directory creation failed, please check permissions or disk space." |
| 0 | 11 exit 1 |
| 12 fi | |
| 13 | |
| 14 hg init "$repo_path" | |
| 15 | |
| 16 sudo chown -R www-data:www-data "$repo_path" | |
| 17 | |
|
1
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
18 |
| 0 | 19 sudo chmod -R 755 "$repo_path" |
| 20 | |
|
1
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
21 echo "Please enter the description :" |
| 0 | 22 read description |
|
1
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
23 echo "Please enter the contact :" |
| 0 | 24 read contact |
| 25 | |
| 26 hgrc_content="[web] | |
| 27 description = $description | |
| 28 contact = $contact" | |
| 29 | |
| 30 hgrc_path="$repo_path/.hg/hgrc" | |
| 31 echo "$hgrc_content" | sudo tee "$hgrc_path" > /dev/null | |
| 32 | |
|
1
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
33 echo "New repositoryinitialized successfully in $repo_path" |
|
44d6d3cb28a0
fix:CreathgRepos.sh Delete Chinese and use English
Pluto <meokcin@gmail.com>
parents:
0
diff
changeset
|
34 echo "The hgrc file has been updated." |
