Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoutBug authored Mar 6, 2022
1 parent 2304d49 commit 2254d9c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions auto_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@

print('\nLooking for default maps...')
url = 'https://github.com/SnoutBug/BeamNG_terrainMaterialCache/releases/download/default/'
for map in default:
print('Getting textures for ' + re.sub('\.tar.gz$', '', map))
urllib.request.urlretrieve(url + map, map)
with tarfile.open(map) as tar:
for filename in default:
print('Getting textures for ' + re.sub('\.tar.gz$', '', filename))
urllib.request.urlretrieve(url + filename, filename)
with tarfile.open(filename) as tar:
tar.extractall(cache)
os.remove(map)
os.remove(filename)

print('All Done!')
except KeyboardInterrupt:
try:
os.remove(filename)
except OSError:
pass
print('\nYou cancelled the download.')

0 comments on commit 2254d9c

Please sign in to comment.