-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_nsrc
More file actions
68 lines (56 loc) · 2.01 KB
/
_nsrc
File metadata and controls
68 lines (56 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export NETSERVA_VERSION="3.0.0"
export NS="${NS:-$HOME/.ns}" # NetServa Directory (root)
export NS_SUCCESS="✅" # Success indicator
export NS_ERROR="❌" # Error indicator
export NS_WARN="⚠️ " # Warning indicator (extra space for alignment)
export NS_INFO="ℹ️ " # Info indicator
export NS_DEBUG="🔍" # Debug indicator
export NS_PROGRESS="🔄" # Progress/working indicator
export NS_DONE="✨" # Completion/done indicator
export NS_ROCKET="🚀" # Launch/start indicator
export NS_LOCK="🔒" # Security/locked indicator
export NS_KEY="🔑" # Key/unlock indicator
export NS_FOLDER="📁" # Folder/directory indicator
export NS_FILE="📄" # File indicator
export NS_MAIL="📧" # Mail indicator
export NS_WEB="🌐" # Web/network indicator
export NS_DB_ICON="🗄️ " # Database icon (renamed to avoid conflict)
alias a='php artisan'
alias c='composer'
alias lx='lxc list'
alias ns_reload='source "$NS/_nsrc"; echo "NetServa environment reloaded"'
if [[ -d "$NS/bin" ]] && [[ ":$PATH:" != *":$NS/bin:"* ]]; then
export PATH="$NS/bin:$PATH"
fi
export NS_DB="$NS/database/database.sqlite"
ns_log() {
local level="$1"
shift
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $*" | tee -a "$NS/storage/logs/netserva.log" >&2
}
ns_db() {
sqlite3 "$NS_DB" "$@"
}
ns_ssh_host_exists() {
local ssh_host="$1"
[[ -f "$HOME/.ssh/hosts/$ssh_host" ]]
}
ns_remote_exec() {
local ssh_host="$1"
shift
ssh "$ssh_host" "sudo" bash -s "$@"
}
nspull() {
cd "$NS"
git pull
}
nspush() {
cd "$NS"
if [[ -n "$1" ]]; then
git commit -am "$*"
else
git commit -a
fi
git push
}