Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
d6863a09
Commit
d6863a09
authored
Mar 07, 2016
by
neil
Browse files
minor, uncomment the conf values
parent
2400e41f
Changes
1
Show whitespace changes
Inline
Side-by-side
le.sh
View file @
d6863a09
...
...
@@ -272,12 +272,13 @@ _setopt() {
__val
=
"
$4
"
__end
=
"
$5
"
if
[
-z
"
$__opt
"
]
;
then
echo
usage:
$0
'"file" "opt" "=" "value" [";"]'
echo
usage:
_setopt
'"file" "opt" "=" "value" [";"]'
return
fi
if
[
!
-f
"
$__conf
"
]
;
then
touch
"
$__conf
"
fi
if
grep
-H
-n
"^
$__opt$__sep
"
"
$__conf
"
>
/dev/null
;
then
_debug OK
if
[[
"
$__val
"
==
*
"&"
*
]]
;
then
...
...
@@ -285,6 +286,14 @@ _setopt() {
fi
text
=
"
$(
cat
$__conf
)
"
printf
"
$text
"
|
sed
"s|^
$__opt$__sep
.*
$|$__opt$__sep$__val$__end
|"
>
"
$__conf
"
elif
grep
-H
-n
"^#
$__opt$__sep
"
"
$__conf
"
>
/dev/null
;
then
if
[[
"
$__val
"
==
*
"&"
*
]]
;
then
__val
=
"
$(
echo
$__val
|
sed
's/&/\\&/g'
)
"
fi
text
=
"
$(
cat
$__conf
)
"
printf
"
$text
"
|
sed
"s|^#
$__opt$__sep
.*
$|$__opt$__sep$__val$__end
|"
>
"
$__conf
"
else
_debug APP
echo
"
$__opt$__sep$__val$__end
"
>>
"
$__conf
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment