mumoshu / variant2

Turn your bash scripts into a modern, single-executable CLI app today
MIT License
141 stars 11 forks source link

Support Interactive Commands #9

Closed osterman closed 4 years ago

osterman commented 4 years ago

what

use-case

Terraform apply can be run interactively on the console. While this is not the primary workflow, especially with gitops, during testing this is nice to "slow things down" and not make any mistakes.

example

First run touch /tmp/test, then create a script with the following and run the example job.

#!/usr/bin/env variant

job "example" {
  description = "interactive test"
  exec {
      command = "rm"
      args = [ "-i", "/tmp/test" ]
   }
}
mumoshu commented 4 years ago

Implemented in https://github.com/mumoshu/variant2/commit/94a6ff9f72a97c6bee6e0df16254c540f5b616cb and available since v0.21.0. Thanks for the feedback and the request, @osterman!