From 42dec677644e4cec6f0011734d95ba5a7f77444c Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Sun, 27 Mar 2022 00:05:52 +0000 Subject: [PATCH] Formatting. --- internal/zenutil/osa_generated.go | 6 ++-- internal/zenutil/osascripts/color.gojs | 2 +- internal/zenutil/osascripts/dialog.gojs | 4 +-- internal/zenutil/osascripts/progress.gojs | 36 +++++++++++------------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/zenutil/osa_generated.go b/internal/zenutil/osa_generated.go index 17eb907..de571e3 100644 --- a/internal/zenutil/osa_generated.go +++ b/internal/zenutil/osa_generated.go @@ -17,14 +17,14 @@ var app=Application.currentApplication() app.includeStandardAdditions=true app.activate() var res=app.chooseColor({defaultColor:{{json .}}}) -{"rgb("+res.map(x=>Math.round(x*255))+")"} +{'rgb('+res.map(x=>Math.round(x*255))+')'} {{- end}} {{define "dialog" -}} var app=Application.currentApplication() app.includeStandardAdditions=true app.activate() -ObjC.import("stdlib") -ObjC.import("stdio") +ObjC.import('stdio') +ObjC.import('stdlib') var res=app.{{.Operation}}({{json .Text}},{{json .Options}}) if(res.gaveUp){$.exit(5)} if(res.buttonReturned==={{json .Extra}}){$.puts(res.buttonReturned) diff --git a/internal/zenutil/osascripts/color.gojs b/internal/zenutil/osascripts/color.gojs index ea0754c..4eb6d60 100644 --- a/internal/zenutil/osascripts/color.gojs +++ b/internal/zenutil/osascripts/color.gojs @@ -3,4 +3,4 @@ app.includeStandardAdditions = true app.activate() var res = app.chooseColor({defaultColor: {{json .}}}) -{"rgb(" + res.map(x => Math.round(x * 255)) + ")"} \ No newline at end of file +{'rgb(' + res.map(x => Math.round(x * 255)) + ')'} \ No newline at end of file diff --git a/internal/zenutil/osascripts/dialog.gojs b/internal/zenutil/osascripts/dialog.gojs index c366d23..2142faf 100644 --- a/internal/zenutil/osascripts/dialog.gojs +++ b/internal/zenutil/osascripts/dialog.gojs @@ -2,8 +2,8 @@ var app = Application.currentApplication() app.includeStandardAdditions = true app.activate() -ObjC.import("stdlib") -ObjC.import("stdio") +ObjC.import('stdio') +ObjC.import('stdlib') var res = app.{{.Operation}}({{json .Text}}, {{json .Options}}) if (res.gaveUp) { diff --git a/internal/zenutil/osascripts/progress.gojs b/internal/zenutil/osascripts/progress.gojs index 45c8102..3cfc9f9 100644 --- a/internal/zenutil/osascripts/progress.gojs +++ b/internal/zenutil/osascripts/progress.gojs @@ -6,29 +6,29 @@ ObjC.import('stdlib') ObjC.import('readline') {{- if .Total}} - Progress.totalUnitCount = {{.Total}} + Progress.totalUnitCount = {{.Total}} {{- end}} {{- if .Description}} - Progress.description = {{json .Description}} + Progress.description = {{json .Description}} {{- end}} while (true) { - var s - try { - s = $.readline('') - } catch (e) { - if (e.errorNumber === -128) $.exit(1) - break - } + var s + try { + s = $.readline('') + } catch (e) { + if (e.errorNumber === -128) $.exit(1) + break + } - if (s.indexOf('#') === 0) { - Progress.additionalDescription = s.slice(1) - continue - } + if (s.indexOf('#') === 0) { + Progress.additionalDescription = s.slice(1) + continue + } - var i = parseInt(s) - if (i >= 0 && Progress.totalUnitCount > 0) { - Progress.completedUnitCount = i - continue - } + var i = parseInt(s) + if (i >= 0 && Progress.totalUnitCount > 0) { + Progress.completedUnitCount = i + continue + } } \ No newline at end of file