Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename _images to image in sphinx2github.sh
- Loading branch information
Showing
1 changed file
with
16 additions
and
9 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 |
|---|---|---|
| @@ -1,20 +1,27 @@ | ||
| #!/bin/sh | ||
|
|
||
| rename() | ||
| { | ||
| old_name=$1 | ||
| new_name=$2 | ||
|
|
||
| if [ -d $old_name ]; then | ||
| rm -rf $new_name | ||
| mv $old_name $new_name | ||
| fi | ||
| } | ||
|
|
||
| cd html | ||
|
|
||
| if [ -d _static ]; then | ||
| rm -rf static | ||
| mv _static static | ||
| fi | ||
| if [ -d _sources ]; then | ||
| rm -rf sources | ||
| mv _sources sources | ||
| fi | ||
| rename _static static | ||
| rename _sources sources | ||
| rename _images images | ||
|
|
||
| file_names="`ls *.html`" | ||
| for file_name in $file_names; do | ||
| sed -e 's/_static/static/g' $file_name | | ||
| sed -e 's/_sources/sources/g' > buf.txt | ||
| sed -e 's/_sources/sources/g' | | ||
| sed -e 's/_images/images/g' > buf.txt | ||
| cp buf.txt $file_name | ||
| rm -f buf.txt | ||
| done |