Skip to content

Commit aa9e98a

Browse files
committed
forgot to completely change repo update func to gaurd for only Travis
1 parent 2b013a9 commit aa9e98a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

adabot/update_cp_org_libraries.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,18 @@ def update_json_file(working_directory, cp_org_dir, output_filename, json_string
137137
""" Clone the circuitpython-org repo, update libraries.json, and push the updates
138138
in a commit.
139139
"""
140-
if not os.path.isdir(cp_org_dir):
141-
os.makedirs(cp_org_dir, exist_ok=True)
142-
if "TRAVIS" in os.environ:
140+
if "TRAIVS" in os.environ:
141+
if not os.path.isdir(cp_org_dir):
142+
os.makedirs(cp_org_dir, exist_ok=True)
143143
git_url = "https://" + os.environ["ADABOT_GITHUB_ACCESS_TOKEN"] + "@github.com/adafruit/circuitpython-org.git"
144144
git.clone("-o", "adafruit", git_url, cp_org_dir)
145-
else:
146-
git.clone("-o", "adafruit", "https://github.com/adafruit/circuitpython-org.git", cp_org_dir)
147-
148-
os.chdir(cp_org_dir)
149-
git.pull()
150-
git.submodule("update", "--init", "--recursive")
145+
os.chdir(cp_org_dir)
146+
git.pull()
147+
git.submodule("update", "--init", "--recursive")
151148

152-
with open(output_filename, "w") as json_file:
153-
json.dump(json_string, json_file, indent=2)
149+
with open(output_filename, "w") as json_file:
150+
json.dump(json_string, json_file, indent=2)
154151

155-
if "TRAVIS" in os.environ:
156152
commit_day = date.date.strftime(datetime.datetime.today(), "%Y-%m-%d")
157153
commit_msg = "adabot: auto-update of libraries.json ({})".format(commit_day)
158154
git.commit("-a", "-m", commit_msg)

0 commit comments

Comments
 (0)