Skip to content

Commit

Permalink
Proper names for shared-state sync subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck committed Feb 24, 2019
1 parent 6332ee5 commit ed81102
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/shared-state/files/usr/bin/shared-state
Expand Up @@ -110,7 +110,7 @@ if arg[1] == "insert" then
for key, lv in pairs(inputTable) do sharedState.insert(key, lv) end
elseif arg[1] == "get" then
sharedState.save("/dev/stdout")
elseif arg[1] == "pull" then
elseif arg[1] == "sync" then
local urls = {}

if arg[3] == nil then
Expand All @@ -135,7 +135,7 @@ elseif arg[1] == "pull" then
if parsedJson then sharedState.sync(parsedJson) end
end
end
elseif arg[1] == "push" then
elseif arg[1] == "reqsync" then
sharedState.sync(JSON.parse(io.stdin:read("*all")))
sharedState.save("/dev/stdout")
elseif arg[1] == "remove" then
Expand Down
2 changes: 1 addition & 1 deletion packages/shared-state/files/www/cgi-bin/shared-state
Expand Up @@ -27,7 +27,7 @@ local tableName = nixio.getenv('PATH_INFO')
if httpMethod == "POST" and type(tableName) == "string" then
local tmpPath = os.tmpname()
tableName = tableName:gsub("%/", "")
local pIn = io.popen("shared-state push "..tableName.." > "..tmpPath)
local pIn = io.popen("shared-state reqsync "..tableName.." > "..tmpPath)
pIn:write(io.stdin:read("*all")); pIn:close()
io.stdout:write(io.input(tmpPath):read("*all"))
os.remove(tmpPath)
Expand Down

0 comments on commit ed81102

Please sign in to comment.