Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script for automatic git push #1288

Open
FastusNumen opened this issue Mar 4, 2024 · 2 comments
Open

Script for automatic git push #1288

FastusNumen opened this issue Mar 4, 2024 · 2 comments

Comments

@FastusNumen
Copy link

FastusNumen commented Mar 4, 2024

I wrote two scripts to automate the git push.

Since I'm a noob with coding and scripting, I'd like to ask if you think there'll be a problem with them, though.

I first created a "push.sh" file to automate the push to GitHub:

#!/bin/bash

echo "***********************************************************" &>> log_push.txt

date '+%A %d/%m/%Y %X' &>> log_push.txt

git add . &>> log_push.txt

git commit -m 'Routine edit' &>> log_push.txt

git push &>> log_push.txt

Then I created "run_manuskript-push.sh" to automatically start Manuskript and then push to GitHub when I close it:

#!/bin/bash

python ~/Desktop/Manuskript/manuskript/bin/manuskript

sh push.sh

The scripts are both on the folder with the .msk file, where the .git is, and when I double click them they automatically open the script in the Git Bash.

This way, I only have to go to my fiction folder, double-click on "run_manuskript-push.sh", and Manuskript starts.

When I close it, the script starts "push.sh" without me doing anything.

Btw, "push.sh" saves the output of the terminal in "log_push.txt", in case there are problems.

It seems to be working well now, but what do you think?

I'm using Windows 11.

Edit: I added "log_push.txt" to ".gitignore", since I couldn't find a way to write the terminal text only after it finished the commands. There's also still the line feed problem #1287 .

@TheJackiMonster
Copy link
Collaborator

I recommend not adding files via git add . because you won't have a lot control over files being committed or not. Instead you could only commit the .msk file and its folder with similar name. That would solve the problem with your log file as well.

There's already an incentive to integrate git into Manuskript as replacement of the currently broken revision system. Maybe you want to add to the discussion: #379 and #871

@FastusNumen
Copy link
Author

I recommend not adding files via git add . because you won't have a lot control over files being committed or not. Instead you could only commit the .msk file and its folder with similar name. That would solve the problem with your log file as well.

Thanks for the tip. I have other folders in there, for images and other things, but thinking about it, I can add them separately when I need.

There's already an incentive to integrate git into Manuskript as replacement of the currently broken revision system. Maybe you want to add to the discussion: #379 and #871

I already saw them. I truly wish I could help, but I'm not good at coding. Most of your talks fly over my head, and I'd be more of a disturbance than help. These scripts are just an easy workaround while I wait for you to incorporate git on Manuskript.

I tried to help my way by writing a tutorial on Royal Road (not yet finished) and mentionning it in a few places. Maybe that will pull in some writer with coding experience willing to help. That's all I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants