From b296fbd8ea57154234cba9991698142147b35577 Mon Sep 17 00:00:00 2001 From: kujirahand Date: Thu, 18 Jan 2018 22:55:19 +0900 Subject: [PATCH] =?UTF-8?q?=E3=80=8E=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=80=8F=E5=91=BD=E4=BB=A4=E3=81=8Cv1?= =?UTF-8?q?=E9=9D=9E=E4=BA=92=E6=8F=9B=E3=81=AA=E3=81=AE=E3=81=A7=E3=80=81?= =?UTF-8?q?v1=E4=BA=92=E6=8F=9B=E3=81=AB=E3=80=82=E3=80=8E=E7=92=B0?= =?UTF-8?q?=E5=A2=83=E5=A4=89=E6=95=B0=E4=B8=80=E8=A6=A7=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=80=8F=E5=91=BD=E4=BB=A4=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= =?UTF-8?q?#259?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin_node.js | 9 ++++++++- test/node_func.js | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugin_node.js b/src/plugin_node.js index 333725a3..5b7eb45e 100644 --- a/src/plugin_node.js +++ b/src/plugin_node.js @@ -93,7 +93,14 @@ const PluginNode = { return path.dirname(path.resolve(nakofile)) } }, - '環境変数取得': { // @環境変数の一覧を返す // @かんきょうへんすうしゅとく + '環境変数取得': { // @環境変数Sを返す // @かんきょうへんすうしゅとく + type: 'func', + josi: [['の']], + fn: function (s) { + return process.env[s] + } + }, + '環境変数一覧取得': { // @環境変数の一覧を返す // @かんきょうへんすういちらんしゅとく type: 'func', josi: [], fn: function () { diff --git a/test/node_func.js b/test/node_func.js index 043e4e3b..d384ca34 100644 --- a/test/node_func.js +++ b/test/node_func.js @@ -31,4 +31,8 @@ describe('node_func', () => { it('ASSERT', () => { cmd('3と3がASSERT等') }) + it('環境変数取得', () => { + const path = process.env['PATH'] + cmp('「PATH」の環境変数取得して表示。', path) + }) })