-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Running sed straight after clone This ensures it's only run against starter pack And it doesn't affect their existing repo
- Loading branch information
1 parent
c3ce6b7
commit 4d6020c
Showing
1 changed file
with
8 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,18 @@ set +x | |
# Ask the user for the installation directory | ||
read -p "Enter the installation directory (e.g., '.' or 'docs'): " install_directory | ||
|
||
# Clone the starter pack repository | ||
# Clone the starter pack repository to a temporary directory | ||
echo "Cloning the starter pack repository..." | ||
git clone [email protected]:canonical/sphinx-docs-starter-pack temp-starter-pack | ||
rm -rf temp-starter-pack/.git | ||
|
||
# Update file contents for install directory | ||
echo "Updating working directory in workflow files..." | ||
sed -i "s|working-directory: .*|working-directory: $install_directory|g" "temp-starter-pack/.github/workflows"/* | ||
echo "Updating .readthedocs.yaml configuration..." | ||
sed -i "s|configuration: .*conf\.py|configuration: $install_directory/conf.py|g" "temp-starter-pack/.readthedocs.yaml" | ||
sed -i "s|requirements: .*|requirements: $install_directory/.sphinx/requirements.txt|g" "temp-starter-pack/.readthedocs.yaml" | ||
|
||
# Create the specified installation directory | ||
echo "Creating the installation directory: $install_directory" | ||
mkdir -p "$install_directory" | ||
|
@@ -23,15 +30,6 @@ echo "Copying workflow files..." | |
mkdir -p .github/workflows | ||
cp -R "$install_directory/.github/workflows"/* .github/workflows | ||
|
||
# Update working-directory field in workflow files | ||
echo "Updating working directory in workflow files..." | ||
sed -i "s|working-directory: .*|working-directory: $install_directory|g" .github/workflows/* | ||
|
||
# Update .readthedocs.yaml configuration | ||
echo "Updating .readthedocs.yaml configuration..." | ||
sed -i "s|configuration: .*conf\.py|configuration: $install_directory/conf.py|g" "$install_directory/.readthedocs.yaml" | ||
sed -i "s|requirements: .*|requirements: $install_directory/.sphinx/requirements.txt|g" "$install_directory/.readthedocs.yaml" | ||
|
||
# Clean up | ||
echo "Cleaning up..." | ||
rm -rf temp-starter-pack | ||
|