⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.101
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
opt
/
nvm
/
test
/
fast
/
Unit tests
/
View File Name :
nvm_tree_contains_path
#!/bin/sh cleanup () { rm tmp/node rmdir tmp rm tmp2/node rmdir tmp2 } die () { echo "$@" ; cleanup; exit 1; } \. ../../../nvm.sh mkdir -p tmp touch tmp/node mkdir -p tmp2 touch tmp2/node [ "$(nvm_tree_contains_path 2>&1)" = "both the tree and the node path are required" ] || die 'incorrect error message with no args' [ "$(nvm_tree_contains_path > /dev/null 2>&1 ; echo $?)" = "2" ] || die 'incorrect error code with no args' [ "$(nvm_tree_contains_path tmp 2>&1)" = "both the tree and the node path are required" ] || die 'incorrect error message with one arg' [ "$(nvm_tree_contains_path > /dev/null 2>&1 ; echo $?)" = "2" ] || die 'incorrect error code with one arg' nvm_tree_contains_path tmp tmp/node || die '"tmp" should contain "tmp/node"' nvm_tree_contains_path tmp tmp2/node && die '"tmp" should not contain "tmp2/node"' nvm_tree_contains_path tmp2 tmp2/node || die '"tmp2" should contain "tmp2/node"' nvm_tree_contains_path tmp2 tmp/node && die '"tmp2" should not contain "tmp/node"' cleanup