Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
Use string.format() to keep code more readable
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.ru>
  • Loading branch information
teran committed Nov 5, 2017
1 parent aeef89d commit ea6db15
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions deduplicator.lrdevplugin/FindDuplicates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ function IndexPhoto(photo)

local imagePath = photo:getRawMetadata("path")
if WIN_ENV == true then
command = '"' .. LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "win" ), binName .. '.exe' ) .. '" ' .. '"' .. imagePath .. '" >>' .. imgsumDatabasePath
command = string.format('"%s" "%s" >> %s',
LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "win" ), binName .. '.exe' ),
imagePath,
imgsumDatabasePath)
quotedCommand = '"' .. command .. '"'
else
command = '"' .. LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "mac" ), binName ) .. '" ' .. '"' .. imagePath .. '" >>' .. imgsumDatabasePath
command = string.format('"%s" "%s" >> %s',
LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "mac" ), binName ),
imagePath,
imgsumDatabasePath)
quotedCommand = command
end

Expand All @@ -86,10 +92,14 @@ function FindDuplicates()
local quotedCommand

if WIN_ENV == true then
command = '"' .. LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "win" ), binName .. '.exe' ) .. '" -json-output -find-duplicates ' .. imgsumDatabasePath
command = string.format('"%s" -json-output -find-duplicates %s',
LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "win" ), binName .. '.exe' ),
imgsumDatabasePath)
quotedCommand = '"' .. command .. '"'
else
command = '"' .. LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "mac" ), binName ) .. '" -json-output -find-duplicates ' .. imgsumDatabasePath
command = string.format('"%s" -json-output -find-duplicates %s',
LrPathUtils.child( LrPathUtils.child( _PLUGIN.path, "mac" ), binName ),
imgsumDatabasePath)
quotedCommand = command
end

Expand Down

0 comments on commit ea6db15

Please sign in to comment.