Compare commits
No commits in common. "c63a902738ce8953638a17721fa76784f579342f" and "79cfcc69484fa9bef6a4493c8a93a98f0080b63a" have entirely different histories.
c63a902738
...
79cfcc6948
12
atom
12
atom
@ -46,6 +46,8 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -57,15 +59,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
help() {
|
||||
cat <<-EOF
|
||||
Options:
|
||||
@ -85,6 +78,7 @@ help() {
|
||||
}
|
||||
|
||||
#parse arguments
|
||||
OPTERR=0
|
||||
while getopts ':c:Cl:T:F:f:B:ShDq' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# https://specifications.freedesktop.org/basedir-spec/latest/
|
||||
|
||||
xdgUpdateData() {
|
||||
local -r programname=AtOM
|
||||
local -r my_data_home="${XDG_DATA_HOME:-$HOME/.local/share}/$programname"
|
||||
local -r new_db_path="$my_data_home/atom.db"
|
||||
|
||||
[[ -d "$my_data_home" ]] || mkdir -p "$my_data_home"
|
||||
mv "$1" "$new_db_path"
|
||||
echo "$new_db_path"
|
||||
}
|
||||
|
||||
xdgUpdateRuntime() {
|
||||
local -r programname=AtOM \
|
||||
my_runtime_dir="${XDG_RUNTIME_DIR:-/tmp}" \
|
||||
|
||||
echo "$my_runtime_dir/$programname"
|
||||
}
|
||||
|
||||
xdgMigrate() {
|
||||
local -r programname=AtOM
|
||||
local -r my_config_home="${XDG_CONFIG_HOME:-$HOME/.config}/$programname"
|
||||
local new_database
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
getConfig
|
||||
new_database=$(xdgUpdateData "$database")
|
||||
database="$new_database"
|
||||
tempdir=$(xdgUpdateRuntime)
|
||||
cffile="$my_config_home/atom.cfg"
|
||||
[[ -d "$my_config_home" ]] || mkdir -p "$my_config_home"
|
||||
writeConfig >"$cffile"
|
||||
}
|
||||
@ -32,6 +32,7 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -41,15 +42,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
while getopts 'urnD' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
@ -32,6 +32,7 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -41,15 +42,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
while getopts 'D' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
@ -32,6 +32,7 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -41,15 +42,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
while getopts 'Dr' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
@ -32,6 +32,7 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -41,15 +42,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
while getopts 'rD' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
@ -34,6 +34,8 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -45,15 +47,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
args="$@"
|
||||
while [ -n "$1" ]
|
||||
do
|
||||
|
||||
@ -32,6 +32,7 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -41,15 +42,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
while getopts 'fm:o:p:*:uD' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
@ -33,6 +33,7 @@ declare -r \
|
||||
\
|
||||
oldIFS="$IFS"
|
||||
|
||||
cffile="$HOME/.atom/atom.cfg"
|
||||
LC_ALL=C
|
||||
|
||||
shopt -s extglob
|
||||
@ -42,15 +43,6 @@ do
|
||||
source "$function"
|
||||
done
|
||||
|
||||
if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \
|
||||
&& [[ -f "$HOME/.atom/atom.cfg" ]]
|
||||
then
|
||||
echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\
|
||||
"Migrating configuration and data to XDG standard"
|
||||
xdgMigrate
|
||||
fi
|
||||
cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg"
|
||||
|
||||
while getopts 'AlacdgptnNyuD' opt
|
||||
do
|
||||
case $opt in
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user