mirror of
https://github.com/frappe/bench.git
synced 2025-01-24 07:28:25 +00:00
removed tempdir
This commit is contained in:
parent
a3f6c4b346
commit
e446848ae0
@ -1,8 +1,7 @@
|
||||
import click
|
||||
|
||||
import os, shutil, tempfile
|
||||
import os, shutil
|
||||
import os.path as osp
|
||||
import contextlib
|
||||
import logging
|
||||
|
||||
from datetime import datetime
|
||||
@ -83,24 +82,6 @@ bench_command.add_command(remote_urls)
|
||||
from bench.commands.install import install
|
||||
bench_command.add_command(install)
|
||||
|
||||
@contextlib.contextmanager
|
||||
def tempchdir(dirpath, cleanup):
|
||||
basedir = os.getcwd()
|
||||
os.chdir(osp.expanduser(dirpath))
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
os.chdir(basedir)
|
||||
cleanup()
|
||||
|
||||
@contextlib.contextmanager
|
||||
def tempdir():
|
||||
dirpath = tempfile.mkdtemp()
|
||||
def cleanup():
|
||||
shutil.rmtree(dirpath)
|
||||
with tempchdir(dirpath, cleanup):
|
||||
yield dirpath
|
||||
|
||||
@click.command('migrate-env')
|
||||
@click.argument('python', type = click.Choice(['python2', 'python3']))
|
||||
@click.option('--no-backup', default = False, help = 'Do not backup the existing Virtual Environment')
|
||||
|
Loading…
x
Reference in New Issue
Block a user