Skip to content

Commit

Permalink
Merge pull request #45 from pj8/same-json-format
Browse files Browse the repository at this point in the history
Same json format
  • Loading branch information
yuki777 authored Apr 29, 2023
2 parents ceeabd4 + c3d64fa commit b4f3fd2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
10 changes: 9 additions & 1 deletion mysql/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ normalOutputs="${normalOutputs}MySQL Successfully created. $optName $optVersion
normalOutputs="${normalOutputs}$commands\n"

jsonOutputs=""
jsonOutputs="$jsonOutputs{\"message\": \"MySQL Successfully created.\", \"name\": \"$optName\", \"version\": \"$optVersion\", \"port\": \"$optPort\", \"confPath\": \"$dir/datadir/$optName/my.cnf\", \"commands\": $commands}"
jsonOutputs="$jsonOutputs{
\"message\": \"MySQL Successfully created.\",
\"name\": \"$optName\",
\"type\": \"mysql\",
\"version\": \"$optVersion\",
\"port\": \"$optPort\",
\"dataDir\": \"$dir/datadir/$optName\",
\"confPath\": \"$dir/datadir/$optName/my.cnf\"
}"

# Output
if [ "$format" = "json" ]; then
Expand Down
11 changes: 10 additions & 1 deletion mysql/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ normalOutputs=""
normalOutputs="${normalOutputs}MySQL Successfully deleted. $optName $optVersion $optPort"

jsonOutputs=""
jsonOutputs="$jsonOutputs{\"message\": \"MySQL Successfully deleted.\", \"name\": \"$optName\", \"version\": \"$optVersion\", \"port\": \"$optPort\"}"
jsonOutputs="$jsonOutputs{
\"message\": \"MySQL Successfully deleted.\",
\"name\": \"$optName\",
\"type\": \"mysql\",
\"version\": \"$optVersion\",
\"port\": \"$optPort\",
\"dataDir\": \"$dir/datadir/$optName\",
\"confPath\": \"$dir/datadir/$optName/my.cnf\"
}"


# Output
if [ "$format" = "json" ]; then
Expand Down
5 changes: 2 additions & 3 deletions mysql/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ jsonOutputs=""
jsonOutputs="$jsonOutputs{
\"message\": \"MySQL Successfully started.\",
\"name\": \"$optName\",
\"type\": \"mysql\",
\"version\": \"$optVersion\",
\"port\": \"$optPort\",
\"confPath\": \"$dir/datadir/$optName/my.cnf\",
\"dataDir\": \"$dir/datadir/$optName\",
\"logError\": \"$dir/datadir/$optName/mysqld.err\",
\"pidFile\": \"$dir/datadir/$optName/mysql.pid\"
\"confPath\": \"$dir/datadir/$optName/my.cnf\"
}"

# Output
Expand Down
10 changes: 9 additions & 1 deletion mysql/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ normalOutputs=""
normalOutputs="${normalOutputs}MySQL Successfully stopped. $optName $optVersion $optPort"

jsonOutputs=""
jsonOutputs="$jsonOutputs{\"message\": \"MySQL Successfully stopped.\", \"name\": \"$optName\", \"version\": \"$optVersion\", \"port\": \"$optPort\", \"confPath\": \"$dir/datadir/$optName/my.cnf\"}"
jsonOutputs="$jsonOutputs{
\"message\": \"MySQL Successfully stopped.\",
\"name\": \"$optName\",
\"type\": \"mysql\",
\"version\": \"$optVersion\",
\"port\": \"$optPort\",
\"dataDir\": \"$dir/datadir/$optName\",
\"confPath\": \"$dir/datadir/$optName/my.cnf\"
}"

# Output
if [ "$format" = "json" ]; then
Expand Down

0 comments on commit b4f3fd2

Please sign in to comment.