Closed kylehodgetts closed 3 years ago
Resolves #40
Wizard should only be used in an interactive context, i.e. with a terminal
To prevent the wizard command from hanging when run without TTY, we should fail fast.
Vagrant required
Build kusk binary for linux export GOOS=linux; go build -o kusk-linux
export GOOS=linux; go build -o kusk-linux
Vagrantfile
Vagrant.configure("2") do |config| config.vm.box = "generic/ubuntu2004" config.vm.box_version = "3.1.16" config.vm.provision "file", source: "kusk-linux", destination: "kusk-linux" end
Spin up vagrant machine vagrant up
vagrant up
Run wizard command without tty vagrant ssh -- -T './kusk-linux wizard -i somefile'
vagrant ssh -- -T './kusk-linux wizard -i somefile'
You can leave somefile as is; the command will fail fast before even attempting to read the input file.
somefile
Expected ~output 2021/07/26 13:14:08 the wizard is only supported in an interactive context i.e. TTY
2021/07/26 13:14:08 the wizard is only supported in an interactive context i.e. TTY
Cleanup vagrant destroy rm Vagrantfile rm kusk-linux
vagrant destroy
rm Vagrantfile
rm kusk-linux
Resolves #40
Wizard should only be used in an interactive context, i.e. with a terminal
To prevent the wizard command from hanging when run without TTY, we should fail fast.
Testing instructions
Vagrant required
Build kusk binary for linux
export GOOS=linux; go build -o kusk-linux
Vagrantfile
Spin up vagrant machine
vagrant up
Run wizard command without tty
vagrant ssh -- -T './kusk-linux wizard -i somefile'
You can leave
somefile
as is; the command will fail fast before even attempting to read the input file.Expected ~output
2021/07/26 13:14:08 the wizard is only supported in an interactive context i.e. TTY
Cleanup
vagrant destroy
rm Vagrantfile
rm kusk-linux