This commit is contained in:
2018-10-05 01:55:37 +04:00
parent 1a780986b6
commit bbfdf8d767

View File

@@ -12,11 +12,11 @@ function mount_sshfs {
return 1
fi
local MOUNTPATH="/Users/abra/mount/$1"
local MOUNT_PATH="/Users/abra/mount/$1"
mkdir -p "$MOUNTPATH"
mkdir -p "$MOUNT_PATH"
umount "$MOUNTPATH" || true;
umount "$MOUNT_PATH" || true;
sshfs \
-o allow_other \
@@ -25,7 +25,23 @@ function mount_sshfs {
-o Compression=no \
-o reconnect \
-o workaround=rename \
"$1:$2" "$MOUNTPATH"
"$1:$2" "$MOUNT_PATH"
local REMOTE_COMMAND_PIPE_PATH="/projects/subl_remote/fifo"
local LOCAL_COMMAND_PIPE_PATH="/Users/abra/mount/$1/$REMOTE_COMMAND_PIPE_PATH"
if [[ ! -e "$LOCAL_COMMAND_PIPE_PATH" ]]; then
echo "Can't file the command pipe"
fi
echo "Starting remote command pipe..."
ssh $1 -- tail -f "$REMOTE_COMMAND_PIPE_PATH" | zsh
}
function sublr {
local FULL_PATH=$(realpath $1)
echo "subl /Users/abra/mount/$HOSTNAME/$FULL_PATH" > /projects/subl_remote/fifo
}
function mkcd {