Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Fixes required for Windows functionality #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion config/credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

'cipher' => config('app.cipher'),

'editor' => env('EDITOR', 'vi')
'editor' => env('EDITOR', 'vi'),

'editorParams' => env('EDITOR_PARAMS'),

'timeout' => env('EDITOR_TIMEOUT', 60)

];
14 changes: 11 additions & 3 deletions src/EditCredentialsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ public function handle(Credentials $credentials)

fwrite($handle, json_encode($decrypted, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT));

$editor = config('credential.editor', 'vi');
$editor = config('credentials.editor', 'vi');
$editorParams = config('credentials.editorParams');

$process = new Process([$editor, $meta['uri']]);
$process = new Process([$editor, $editorParams, $meta['uri']],
null,
null,
null,
config('credentials.timeout'));

$process->setTty(true);
if (!(stripos(PHP_OS, 'WIN') === 0 || PHP_OS_FAMILY === "Windows"))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @b0ric

{
$process->setTty(true);
}
$process->mustRun();

$data = json_decode(file_get_contents($meta['uri']), JSON_OBJECT_AS_ARRAY);
Expand Down