]> git.phdru.name Git - ansible.git/commitdiff
Feat(venv): Copy hooks to `venv/bin` master
authorOleg Broytman <phd@phdru.name>
Wed, 24 Sep 2025 12:17:38 +0000 (15:17 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 24 Sep 2025 12:18:59 +0000 (15:18 +0300)
mk-ansible-venv [new file with mode: 0644]
mk-venvw-ansible [deleted file]
venv-bin/postactivate [new file with mode: 0644]
venv-bin/predeactivate [new file with mode: 0644]

diff --git a/mk-ansible-venv b/mk-ansible-venv
new file mode 100644 (file)
index 0000000..67e4ff2
--- /dev/null
@@ -0,0 +1,2 @@
+mkvirtualenv -a ~/admin/ansible/playbooks -i ansible -p python3.11 ansible &&
+(cd ~/admin/ansible/venv-bin && exec cp -ap * ~/.virtualenvs/ansible/bin)
diff --git a/mk-venvw-ansible b/mk-venvw-ansible
deleted file mode 100644 (file)
index 11aca9d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-mkvirtualenv -a ~/admin/ansible/playbooks -i ansible -p python3.11 ansible
diff --git a/venv-bin/postactivate b/venv-bin/postactivate
new file mode 100644 (file)
index 0000000..9b8ece9
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+# This hook is sourced after this virtualenv is activated.
+
+# Fake but neccessary
+_SAVE_CTYPE=$LC_CTYPE
+LC_CTYPE=ru_RU.UTF-8
diff --git a/venv-bin/predeactivate b/venv-bin/predeactivate
new file mode 100644 (file)
index 0000000..45b819e
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+# This hook is sourced before this virtualenv is deactivated.
+
+LC_CTYPE=$_SAVE_CTYPE
+unset _SAVE_CTYPE