77 "context"
88 "fmt"
99 "os"
10+ "path/filepath"
1011 "strings"
1112
1213 "github.com/pterm/pterm"
@@ -177,6 +178,13 @@ func runTaskCommand(cmd *cobra.Command, args []string) error {
177178
178179 // Safe PATH merging to avoid hardcoded colons and exponential explosion on Windows
179180 newPath := shimsDir + string (os .PathListSeparator ) + env .Get ("PATH" )
181+
182+ // Also inject the directory of the current unirtm executable so scripts can find it
183+ exePath , err := os .Executable ()
184+ if err == nil {
185+ exeDir := filepath .Dir (exePath )
186+ newPath = shimsDir + string (os .PathListSeparator ) + exeDir + string (os .PathListSeparator ) + env .Get ("PATH" )
187+ }
180188
181189 // Deduplicate inline to keep PATH clean
182190 cleanPath := envpath .DeduplicateOSPaths (newPath )
@@ -193,6 +201,19 @@ func runTaskCommand(cmd *cobra.Command, args []string) error {
193201 // Execute task
194202 if err := engine .Execute (ctx , cwd , taskName , taskArgs , envInjects ); err != nil {
195203 if strings .Contains (err .Error (), "no suitable task runner found" ) {
204+ // Check if local config is untrusted/modified and print a friendly hint
205+ tm := config .NewTrustManager ()
206+ for _ , f := range []string {".unirtm.toml" , "unirtm.toml" } {
207+ p := filepath .Join (cwd , f )
208+ if _ , err := os .Stat (p ); err == nil {
209+ status := tm .TrustStatus (p )
210+ if status != config .TrustStatusTrusted {
211+ pterm .Warning .Printf ("Tasks in %s are ignored because the configuration file is not trusted.\n Please run 'unirtm trust' to enable them.\n \n " , f )
212+ break
213+ }
214+ }
215+ }
216+
196217 // Suggest similar tasks or commands if not found
197218 var candidates []string
198219 for name := range cfg .Tasks {
0 commit comments