Skip to content

Commit 3ec4501

Browse files
committed
update: change weapon location to customizable
1 parent af98c76 commit 3ec4501

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

installer.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function check_command() {
1212
function check_requirements() {
1313
check_command "awk" "awk is required for parsing the output of commands, please install it." || return 2
1414
check_command "sed" "sed is required for parsing the output of commands, please install it." || return 2
15+
check_command "grep" "grep is required for parsing the output of commands, please install it." || return 2
16+
check_command "tr" "tr is required for parsing the output of commands, please install it." || return 2
1517
check_command "zsh" "zsh is core to WeaponizedVSCode integrated shell." || return 2
1618
check_command "vim" "vim is required for task edit /etc/hosts, please install it or change it." || return 2
1719
check_command "nc" "nc is core for netcat shell session handling or u can't use it, please install it." || return 2
@@ -52,7 +54,7 @@ function main() {
5254
mkdir -p $LOCATION && echo "Weapon directory created at $LOCATION."
5355
cp -f ./createhackenv.sh $LOCATION && echo "createhackenv.sh copied to $LOCATION."
5456
echo "" >>$LOCATION/createhackenv.sh
55-
echo "export WEAPON_LOCATION=$LOCATION" >>$LOCATION/createhackenv.sh # overwrite if exists
57+
sed -i "s/__REPLACE__/$LOCATION/g" $LOCATION/createhackenv.sh && echo "createhackenv.sh updated with WEAPON_LOCATION."
5658
cp -f ./zsh_history $LOCATION && echo "zsh_history copied to $LOCATION."
5759

5860
grep -zq "source $LOCATION/createhackenv.sh" ~/.zshrc
@@ -64,7 +66,6 @@ function main() {
6466
fi
6567

6668
echo "Weaponized VSCode installation completed."
67-
6869
}
6970

7071
main "$@"

launch_helper.zsh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
export WEAPON_LOCATION=__REPLACE__
2+
13
weapon_vscode_launch_helper () {
2-
if [ -f ~/.local/weapon/zsh_history ]; then
3-
export HIST_COMMAND_INDEXER=~/.local/weapon/zsh_history
4+
if [ -f ${WEAPON_LOCATION}/zsh_history ]; then
5+
export HIST_COMMAND_INDEXER=${WEAPON_LOCATION}/zsh_history
46
fi
57
if [ -n "$PROJECT_FOLDER" ]; then
68
if [ -f "$PROJECT_FOLDER/.vscode/.zshrc" ]; then

0 commit comments

Comments
 (0)