From 517584a5e44ce346ad287e28dd44e1d654cb21ee Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sat, 2 Oct 2021 11:37:54 +0200 Subject: [PATCH] Improve script for setting up interoperability with Overleaf --- README.md | 11 +++++++---- .../helpers/set-up-overleaf.sh | 13 +++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7702dfa..ef44073 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,14 @@ following templates are handled: If you are to use another template, prepare an MR to this repo first! 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 -package to Overleaf first: +Overleaf handles git but in an imperfect way (to put it mildly). +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. 2. Run `make` diff --git a/{{cookiecutter.paper_repo_name}}/helpers/set-up-overleaf.sh b/{{cookiecutter.paper_repo_name}}/helpers/set-up-overleaf.sh index 954d761..743d56f 100755 --- a/{{cookiecutter.paper_repo_name}}/helpers/set-up-overleaf.sh +++ b/{{cookiecutter.paper_repo_name}}/helpers/set-up-overleaf.sh @@ -1,9 +1,18 @@ -#!/bin/bash -x +#!/bin/bash -e echo "Setting up interoperability with Overleaf..." echo "Note that you need ability to clone repos from Overleaf." 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) @@ -45,7 +54,7 @@ cookiecutter https://git.wmi.amu.edu.pl/filipg/paper-cutter.git --checkout maste git add --all 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 origin master