Skip to content

Commit

Permalink
『環境変数取得』命令がv1非互換なので、v1互換に。『環境変数一覧取得』命令を追加。#259
Browse files Browse the repository at this point in the history
  • Loading branch information
kujirahand committed Jan 18, 2018
1 parent 7fcfe3c commit b296fbd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plugin_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 4 additions & 0 deletions test/node_func.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ describe('node_func', () => {
it('ASSERT', () => {
cmd('3と3がASSERT等')
})
it('環境変数取得', () => {
const path = process.env['PATH']
cmp('「PATH」の環境変数取得して表示。', path)
})
})

0 comments on commit b296fbd

Please # to comment.