File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import click
5
5
from copier import run_copy
6
+ from dotenv import load_dotenv
6
7
7
8
from pyaction import __version__
8
9
from pyaction .consts import PROJECT_NAME , TEMPLATE_PATH
@@ -26,12 +27,13 @@ def init() -> None:
26
27
27
28
@cli .command (
28
29
"run" ,
29
- help = "Runs the action locally based on the .env file " ,
30
+ help = "Runs the action locally" ,
30
31
)
31
32
def run () -> None :
32
33
if not os .path .isfile (".env" ):
33
34
raise FileNotFoundError (
34
- "Make sure you have the `.env` file inside the root path of your action directory."
35
+ "Make sure you have the `.env` file in the root path of your action directory."
35
36
)
36
37
37
- subprocess .check_call ("env $(cat .env | xargs) python main.py" , shell = True )
38
+ load_dotenv (".env" )
39
+ subprocess .call (["python" , "main.py" ])
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ classifiers = [
19
19
" Environment :: Console" ,
20
20
" Intended Audience :: Developers" ,
21
21
" License :: OSI Approved :: MIT License" ,
22
- " Operating System :: OS Independent " ,
22
+ " Operating System :: POSIX " ,
23
23
" Programming Language :: Python" ,
24
24
" Programming Language :: Python :: 3.8" ,
25
25
" Programming Language :: Python :: 3.9" ,
@@ -39,6 +39,7 @@ cli = [
39
39
" copier >= 9.2" ,
40
40
" click >= 8.1" ,
41
41
" rich >= 13.7.1" ,
42
+ " python-dotenv >= 1.0.1" ,
42
43
]
43
44
44
45
[project .urls ]
You can’t perform that action at this time.
0 commit comments