@@ -137,22 +137,18 @@ def update_json_file(working_directory, cp_org_dir, output_filename, json_string
137
137
""" Clone the circuitpython-org repo, update libraries.json, and push the updates
138
138
in a commit.
139
139
"""
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 )
143
143
git_url = "https://" + os .environ ["ADABOT_GITHUB_ACCESS_TOKEN" ] + "@github.com/adafruit/circuitpython-org.git"
144
144
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" )
151
148
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 )
154
151
155
- if "TRAVIS" in os .environ :
156
152
commit_day = date .date .strftime (datetime .datetime .today (), "%Y-%m-%d" )
157
153
commit_msg = "adabot: auto-update of libraries.json ({})" .format (commit_day )
158
154
git .commit ("-a" , "-m" , commit_msg )
0 commit comments