Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10433506
files_nix.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
833 B
Subscribers
None
files_nix.go
View Options
// +build !windows
package
config
import
(
"fmt"
"os/exec"
homedir
"github.com/mitchellh/go-homedir"
"github.com/writeas/writeas-cli/executable"
)
const
(
NoEditorErr
=
"Couldn't find default editor. Try setting $EDITOR environment variable in ~/.profile"
)
func
parentDataDir
()
string
{
dir
,
err
:=
homedir
.
Dir
()
if
err
!=
nil
{
panic
(
err
)
}
return
dir
}
func
EditPostCmd
(
fname
string
)
*
exec
.
Cmd
{
editor
:=
GetConfiguredEditor
()
if
editor
==
""
{
// Fall back to default editor
path
,
err
:=
exec
.
LookPath
(
"vim"
)
if
err
!=
nil
{
path
,
err
=
exec
.
LookPath
(
"nano"
)
if
err
!=
nil
{
return
nil
}
}
editor
=
path
}
return
exec
.
Command
(
editor
,
fname
)
}
func
MessageRetryCompose
(
fname
string
)
string
{
return
fmt
.
Sprintf
(
"To retry this post, run:\n cat %s | %s"
,
fname
,
executable
.
Name
())
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 20, 4:11 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3135693
Attached To
rWCLI writeas-cli
Event Timeline
Log In to Comment