1
bashスクリプトの変数に文字列(別のファイルに格納されているファイルの名前)を読み込んでいます。実行するための
私の元のコマンドは、スクリプトファイルに直接書き込まれている場合は良い作品分度器conf.jsは、バッチスクリプトの変数を実行しているときにのみ '仕様が見つかりません'を返します。
protractor conf.js --specs 'LeadershipBoard.js'
です。しかし、以下は動作しません。
protractor conf.js --specs $value
「指定された仕様がありません。0秒で終了しました」を返します。ここに私のRunConf.shファイルがあります
#!/bin/bash
value=$(<string.txt)
echo $value // 'LeadershipBoard.js'
commandForConf="protractor conf.js --specs $value"
echo $commandForConf // protractor conf.js --specs 'LeadershipBoards.js'
eval "$commandForConf" // No specs found
eval "protractor conf.js --specs 'LeadershipBoard.js'" // 6 specs found, 0 failures
私はeval "$ commandForConf"を動作させたいと思います。ここで私はエラーが私は、ファイルのJS関数として保存HTMLからのデータを保存されたファイルに「string.txt」からだったことが判明コンソール
$ sh RunConf.sh
'LeadershipBoard.js'
protractor conf.js --specs 'LeadershipBoard.js'
[15:49:35] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[15:49:35] I/launcher - Running 1 instances of WebDriver
Started
No specs found Finished in 0 seconds
[15:49:46] I/launcher - 0 instance(s) of WebDriver still running
[15:49:46] I/launcher - internet explorer11 #01 passed
[15:49:54] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[15:49:54] I/launcher - Running 1 instances of WebDriver Started
6 specs, 0 failures Finished in 58.478 seconds
[15:51:00] I/launcher - 0 instance(s) of WebDriver still running
[15:51:00] I/launcher - internet explorer11 #01 passed
ファイルアクセス権の問題が間違いありません。それを確認してください! –