Skip to content

Commit 68abdc3

Browse files
quazgarDaniel
andauthored
FEAT: Check if activate is called as script. (#384)
Co-authored-by: Daniel <d.hornung@indiscale.com>
1 parent d985d9b commit 68abdc3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Nodeenv changelog
22
=================
33

4+
Version [unreleased]
5+
--------------------
6+
7+
- Added check for how `activate` is called.
8+
49
Version 1.3.1
510
-------------
611
- Windows related fix `#207 <https://github.com/ekalinin/nodeenv/pull/207>`_

nodeenv.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,16 @@ def main():
13421342
fi
13431343
}
13441344
1345+
1346+
# Detect calling this file as a script
1347+
case $0 in
1348+
*/bin/activate )
1349+
echo "Do not call $0 directly. Instead source it with \`source $0\`."
1350+
exit 1
1351+
;;
1352+
esac
1353+
1354+
13451355
# unset irrelevant variables
13461356
deactivate_node nondestructive
13471357

0 commit comments

Comments
 (0)