Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Commit

Permalink
fix(config): Using term program to check environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Feb 22, 2022
1 parent bb1adb3 commit 6e637aa
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions mkdocs_obsidian/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import os.path
import subprocess
import sys
from datetime import datetime
from pathlib import Path
Expand Down Expand Up @@ -52,7 +53,6 @@ def ashell_environment(console):
:param console: rich console
:return vault_path, blog_path
"""
import subprocess
vault = ""
blog = ""
console.print("Please provide your [u bold]obsidian vault[/] path: ")
Expand Down Expand Up @@ -111,12 +111,9 @@ def create_env():
BASEDIR = BASEDIR.parent.absolute()
except ModuleNotFoundError:
pass
version = sys.version.split('\n')
ashell = False
if len(version) > 1:
version = version[1]
if 'Clang' in version:
ashell = True
process = subprocess.Popen('echo $TERM_PROGRAM', stdout=subprocess.PIPE)
output, error = process.communicate()
ashell = output.decode("utf-8").strip()=='a-Shell'
console = Console()
env_path = Path(f"{BASEDIR}/.mkdocs_obsidian")
print(f"[bold]Creating environnement in [u]{env_path}[/][/]")
Expand Down

0 comments on commit 6e637aa

Please sign in to comment.