Improve script for setting up interoperability with Overleaf

This commit is contained in:
Filip Gralinski 2021-10-02 11:37:54 +02:00
parent 65521e35df
commit 517584a5e4
2 changed files with 18 additions and 6 deletions

View File

@ -31,11 +31,14 @@ following templates are handled:
If you are to use another template, prepare an MR to this repo first! If you are to use another template, prepare an MR to this repo first!
Do not add directly to your specific paper. Do not add directly to your specific paper.
Interoperation with Overleaf Interoperatibility with Overleaf
---------------------------- --------------------------------
Overleaf handles git but in an imperfect way (to put it mildly). It's better to upload a Overleaf handles git but in an imperfect way (to put it mildly).
package to Overleaf first: It's better to upload a package to Overleaf first.
You can do this by running `helpers/set-up-overleaf.sh` after creating a project
or carrying out the following steps manually:
1. Create a project locally. 1. Create a project locally.
2. Run `make` 2. Run `make`

View File

@ -1,9 +1,18 @@
#!/bin/bash -x #!/bin/bash -e
echo "Setting up interoperability with Overleaf..." echo "Setting up interoperability with Overleaf..."
echo "Note that you need ability to clone repos from Overleaf." echo "Note that you need ability to clone repos from Overleaf."
original_git_url=$(git remote get-url origin) original_git_url=$(git remote get-url origin)
echo "Make sure $original_git_url exists at your git server."
echo "It should be created as en empty repo, *uncheck* option"
echo "'Initialize repository with a README' or similar."
echo ""
echo "Press ENTER to start"
read
here_dir=$(basename $PWD) here_dir=$(basename $PWD)
@ -45,7 +54,7 @@ cookiecutter https://git.wmi.amu.edu.pl/filipg/paper-cutter.git --checkout maste
git add --all git add --all
git commit -m 'Bring back all the files' git commit -m 'Bring back all the files'
perl -pne 's/OVERLEAF_GIT_URL=/OVERLEAF_GIT_URL='$overleaf_git_url'/' -i helpers/vars perl -pne 's{OVERLEAF_GIT_URL=}{OVERLEAF_GIT_URL='$overleaf_git_url'}' -i helpers/vars
git push overleaf master git push overleaf master
git push origin master git push origin master