mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix bug with first-launching
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from os import listdir
|
from os import listdir, makedirs
|
||||||
from os.path import getmtime, isfile, join
|
from os.path import getmtime, isdir, isfile, join
|
||||||
from sys import exit as sys_exit
|
from sys import exit as sys_exit
|
||||||
from time import time
|
from time import time
|
||||||
from traceback import format_exc
|
from traceback import format_exc
|
||||||
@ -47,6 +47,8 @@ def autocheck_latest_version():
|
|||||||
checkfile = join(get_home_dir(), ".pioupgrade")
|
checkfile = join(get_home_dir(), ".pioupgrade")
|
||||||
if isfile(checkfile) and getmtime(checkfile) > (time() - check_interval):
|
if isfile(checkfile) and getmtime(checkfile) > (time() - check_interval):
|
||||||
return False
|
return False
|
||||||
|
if not isdir(get_home_dir()):
|
||||||
|
makedirs(get_home_dir())
|
||||||
with open(checkfile, "w") as f:
|
with open(checkfile, "w") as f:
|
||||||
f.write(str(time()))
|
f.write(str(time()))
|
||||||
return get_latest_version() != __version__
|
return get_latest_version() != __version__
|
||||||
|
Reference in New Issue
Block a user