-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2c9ede
commit 782bc68
Showing
3 changed files
with
9 additions
and
11 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
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
# - Add Marlin config files, but reset all to defaults. | ||
# - Commit this so changes will be clear in following commits. | ||
# - Add changed Marlin config files and commit. | ||
# - Add remaining files such as README, etc., and commit. | ||
# | ||
# manual - Import changes from a local Marlin folder, then init. | ||
# - Replace 'default' configs with your local Marlin configs. | ||
|
@@ -24,13 +25,13 @@ | |
# - Add a #define CONFIG_EXAMPLES_DIR to each Configuration*.h file. | ||
# | ||
# CI - Run in CI mode, using the current folder as the repo. | ||
# - For GitHub Actions to update the Configurations repo. | ||
# - Used by GitHub Actions to update the Configurations repo. | ||
# | ||
import os, sys, subprocess, shutil, datetime, tempfile | ||
from pathlib import Path | ||
|
||
# Set to 1 for extra debug commits (no deployment) | ||
DEBUG = 0 | ||
DEBUG = 1 | ||
|
||
# Get the shell arguments into ACTION, IMPORT, and EXPORT | ||
ACTION = sys.argv[1] if len(sys.argv) > 1 else 'manual' | ||
|
@@ -70,11 +71,7 @@ if not CONFIGREPO.exists(): | |
# Run git within CONFIGREPO | ||
GITSTDERR = None if DEBUG else subprocess.DEVNULL | ||
def git(etc): | ||
if DEBUG: | ||
print(f"> git {' '.join(etc)}") | ||
if etc[0] == "push": | ||
info("*** DRY RUN ***") | ||
return subprocess.run(["echo"]) | ||
if DEBUG: print(f"> git {' '.join(etc)}") | ||
return subprocess.run(["git"] + etc, cwd=CONFIGREPO, stdout=subprocess.PIPE, stderr=GITSTDERR) | ||
|
||
# Get the current branch name | ||
|
@@ -93,8 +90,8 @@ def gitbd(name): return git(["branch", "-D", name]).stdout | |
def changes(): return git(["status", "--porcelain"]).stdout.decode().strip() | ||
|
||
# Configure git user | ||
git(["config", "user.email", "[email protected]"]) | ||
git(["config", "user.name", "Scott Lahteine"]) | ||
git(["config", "user.email", "\"[email protected]\""]) | ||
git(["config", "user.name", "\"Scott Lahteine\""]) | ||
|
||
# Stash uncommitted changes at the destination? | ||
if changes(): | ||
|
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