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

Commit

Permalink
fix(config): Use $TERM_PROGRAM to check ashell
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Feb 23, 2022
1 parent 8503f40 commit ed721cb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions mkdocs_obsidian/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os.path
import sys
import subprocess
from datetime import datetime
from pathlib import Path
from rich.console import Console
Expand Down Expand Up @@ -56,8 +57,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 @@ -116,12 +115,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 ed721cb

Please sign in to comment.