Skip to content

Commit 0588420

Browse files
authored
Merge pull request #8 from 4513ECHO/fix/deno_args
fix: Use g:denops#server#deno_args in template
2 parents 7d33db6 + 2c578c7 commit 0588420

6 files changed

Lines changed: 15 additions & 9 deletions

File tree

autoload/denops_shared_server/launchctl.template

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
<array>
1010
<string>{{deno}}</string>
1111
<string>run</string>
12-
<string>-A</string>
13-
<string>--no-check</string>
14-
<string>--unstable</string>
12+
{{deno_args}}
1513
<string>{{script}}</string>
1614
<string>--hostname</string>
1715
<string>{{hostname}}</string>

autoload/denops_shared_server/launchctl.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let s:file = expand('<sfile>:p')
2-
let s:name = "io.github.vim-denops.LaunchAtLogin"
2+
let s:name = 'io.github.vim-denops.LaunchAtLogin'
33
let s:plist_file = expand(printf('~/Library/LaunchAgents/%s.plist', s:name))
44
let s:template_file = printf('%s/launchctl.template', fnamemodify(s:file, ':h'))
55

@@ -11,6 +11,8 @@ function! denops_shared_server#launchctl#install(options) abort
1111
\ 'script': a:options.script,
1212
\ 'hostname': a:options.hostname,
1313
\ 'port': a:options.port,
14+
\ 'deno_args': join(map(copy(g:denops#server#deno_args),
15+
\ { _, val -> printf('<string>%s</string>', val) }), "\n"),
1416
\})
1517
call denops#util#info(printf('create the plist `%s`', s:plist_file))
1618
call mkdir(fnamemodify(s:plist_file, ':h'), 'p')

autoload/denops_shared_server/runtray.template.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
"description": "denops.vim shared server",
44
"executable": "{{deno}}",
55
"arguments": [
6-
"run", "-A", "--no-check", "--unstable", "{{script}}",
7-
"--hostname", "{{hostname}}",
8-
"--port", "{{port}}"
6+
"run",
7+
"{{deno_args}}",
8+
"{{script}}",
9+
"--hostname",
10+
"{{hostname}}",
11+
"--port",
12+
"{{port}}"
913
]
1014
}

autoload/denops_shared_server/runtray.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function! denops_shared_server#runtray#install(options) abort
1313
\ 'script': escape(a:options.script, '\'),
1414
\ 'hostname': a:options.hostname,
1515
\ 'port': a:options.port,
16+
\ 'deno_args': json_encode(g:denops#server#deno_args)[2:-3],
1617
\})
1718
call denops#util#info(printf('create the configuration file `%s`', s:config_file))
1819
call mkdir(fnamemodify(s:config_file, ':h'), 'p')

autoload/denops_shared_server/systemctl.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Description = Denops shared server
44
[Service]
55
Type=simple
66
Restart = always
7-
ExecStart={{deno}} run -A --no-check --unstable {{script}} --hostname {{hostname}} --port {{port}}
7+
ExecStart={{deno}} run {{deno_args}} {{script}} --hostname {{hostname}} --port {{port}}
88

99
[Install]
1010
WantedBy=default.target

autoload/denops_shared_server/systemctl.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let s:file = expand('<sfile>:p')
2-
let s:name = "denops-shared-server"
2+
let s:name = 'denops-shared-server'
33
let s:unit_file = expand(printf('~/.config/systemd/user/%s.service', s:name))
44
let s:template_file = printf('%s/systemctl.template', fnamemodify(s:file, ':h'))
55

@@ -9,6 +9,7 @@ function! denops_shared_server#systemctl#install(options) abort
99
\ 'script': a:options.script,
1010
\ 'hostname': a:options.hostname,
1111
\ 'port': a:options.port,
12+
\ 'deno_args': join(g:denops#server#deno_args, ' '),
1213
\})
1314
call denops#util#info(printf('create the unit file `%s`', s:unit_file))
1415
call mkdir(fnamemodify(s:unit_file, ':h'), 'p')

0 commit comments

Comments
 (0)