Skip to content

Commit 1a48d38

Browse files
authored
Merge pull request #219 from roots/add-init-check-for-commands
Add warning when project is not initialized
2 parents 00a2380 + c82c6bd commit 1a48d38

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

trellis/trellis.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package trellis
33
import (
44
"errors"
55
"fmt"
6+
"github.com/fatih/color"
67
"gopkg.in/ini.v1"
78
"gopkg.in/yaml.v2"
89
"io/ioutil"
@@ -105,6 +106,18 @@ func (t *Trellis) LoadProject() error {
105106
if os.Getenv("TRELLIS_VENV") != "false" {
106107
if t.Virtualenv.Initialized() {
107108
t.Virtualenv.Activate()
109+
} else {
110+
color.Yellow(`
111+
WARNING: no virtualenv found for this project. Trellis may not work as expected.
112+
To ensure you have the required dependencies, initialize the project with the following command:
113+
114+
$ trellis init
115+
116+
`)
117+
118+
color.Yellow(`To disable this automated check, set the TRELLIS_VENV environment variable to 'false': export TRELLIS_VENV=false
119+
120+
`)
108121
}
109122
}
110123

0 commit comments

Comments
 (0)