-
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.
The file takes the working dir as input Then it copies and updates files as necessary
- Loading branch information
1 parent
6716831
commit 24368f3
Showing
1 changed file
with
39 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
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 | ||
echo "Cloning the starter pack repository..." | ||
git clone [email protected]:canonical/sphinx-docs-starter-pack temp-starter-pack | ||
rm -rf temp-starter-pack/.git | ||
|
||
# Create the specified installation directory | ||
echo "Creating the installation directory: $install_directory" | ||
mkdir -p "$install_directory" | ||
|
||
# Copy the contents of the starter pack repository to the installation directory | ||
echo "Copying contents to the installation directory..." | ||
cp -R temp-starter-pack/* temp-starter-pack/.??* "$install_directory" | ||
|
||
# Copy workflow files | ||
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: .*|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 | ||
|
||
echo "Setup completed!" |