mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-01 19:26:41 +02:00
Update README.md
This commit is contained in:
parent
bc9395e0e2
commit
f3c242d960
1 changed files with 30 additions and 1 deletions
29
README.md
29
README.md
|
@ -847,3 +847,32 @@ STRING :q!
|
||||||
DELAY 500
|
DELAY 500
|
||||||
ENTER
|
ENTER
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The DevOps way
|
||||||
|
|
||||||
|
Credit: @frank-bee
|
||||||
|
```
|
||||||
|
provider "local" {
|
||||||
|
version = "~> 2.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "local_file" "exit_vim_script" {
|
||||||
|
content = <<-EOF
|
||||||
|
#!/bin/bash
|
||||||
|
ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9
|
||||||
|
EOF
|
||||||
|
filename = "${path.module}/exit_vim.sh"
|
||||||
|
file_permission = "0755"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "null_resource" "run_exit_vim_script" {
|
||||||
|
provisioner "local-exec" {
|
||||||
|
command = "${path.module}/exit_vim.sh"
|
||||||
|
}
|
||||||
|
|
||||||
|
triggers = {
|
||||||
|
always_run = "${timestamp()}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue