mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-02 19:56:14 +02:00
Update README.md
This commit is contained in:
parent
bc9395e0e2
commit
f3c242d960
1 changed files with 30 additions and 1 deletions
31
README.md
31
README.md
|
@ -846,4 +846,33 @@ DELAY 500
|
|||
STRING :q!
|
||||
DELAY 500
|
||||
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