mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-17 23:52:46 +01:00
Fix install (version file) when the source has not been downloaded with Git.
This commit is contained in:
parent
0f10c5aa19
commit
1b892744a6
18
setup.py
18
setup.py
@ -52,6 +52,7 @@ import subprocess
|
|||||||
plugins = [s for s in os.listdir('plugins') if
|
plugins = [s for s in os.listdir('plugins') if
|
||||||
os.path.exists(os.path.join('plugins', s, 'plugin.py'))]
|
os.path.exists(os.path.join('plugins', s, 'plugin.py'))]
|
||||||
|
|
||||||
|
version = None
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
|
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
@ -60,14 +61,17 @@ try:
|
|||||||
.replace(' +', '+') \
|
.replace(' +', '+') \
|
||||||
.replace(' ', 'T')
|
.replace(' ', 'T')
|
||||||
|
|
||||||
try:
|
|
||||||
os.unlink(os.path.join('src', 'version.py'))
|
|
||||||
except OSError: # Does not exist
|
|
||||||
pass
|
|
||||||
open(os.path.join('src', 'version.py'), 'a').write(
|
|
||||||
"version = '0.83.4.1+limnoria %s'\n" % version)
|
|
||||||
except:
|
except:
|
||||||
raise
|
pass
|
||||||
|
if not version:
|
||||||
|
from time import gmtime, strftime
|
||||||
|
version = 'installed on ' + strftime("%Y-%m-%dT%H:%M:%S+0000", gmtime())
|
||||||
|
try:
|
||||||
|
os.unlink(os.path.join('src', 'version.py'))
|
||||||
|
except OSError: # Does not exist
|
||||||
|
pass
|
||||||
|
open(os.path.join('src', 'version.py'), 'a').write(
|
||||||
|
"version = '0.83.4.1+limnoria %s'\n" % version)
|
||||||
|
|
||||||
from src.version import version
|
from src.version import version
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user