当前位置: 动力学知识库 > 问答 > 编程问答 >

node.js - ArangoDB foxx-manager with gulp doesn't know command --server.database

问题描述:

I want to run setup.js script every time i change it. I wrote following gulp script:

gulp.task('db_server_setup', function(){

gulp.src(paths.db_server_setup)

.pipe(gulp.dest(paths.db_dist))

.pipe(callback(() => {

process.execFile('C:/Program Files/ArangoDB 2.8/bin/foxx-manager.exe', ['--server.database "my_db_name" run "/db" setup'], {stdio: 'inherit'}, exec_output);

}));

});

But it results in:

{ [Error: Command failed: C:/Program Files/ArangoDB

2.8/bin/foxx-manager.exe --server.database "my_db_name" run "/db" setup

C:/Program Files/ArangoDB 2.8/bin/foxx-manager.exe: unrecognized option '--server.database "my_db_name" run "/db" setup'

Did you mean one of these? --help --quiet

2016-02-16T13:42:17Z [1564] FATAL illegal option

]

killed: false,

code: 1,

signal: null,

cmd: 'C:/Program Files/ArangoDB 2.8/bin/foxx-manager.exe --server.database "my_db_name" run "/db" setup' }

C:/Program Files/ArangoDB 2.8/bin/foxx-manager.exe: unrecognized option '--server.database "my_db_name" run "/db" setup'

Did you mean one of these? --help --quiet

2016-02-16T13:42:17Z [1564] FATAL illegal option

When I exec "C:/Program Files/ArangoDB 2.8/bin/foxx-manager.exe" --server.database "organize_me" run "/db" setup it runs succesfully

{"code": 200}

How can i achieve to rerun setup script with gulp everytime I change it?

Thanks

网友答案:

This looks more like a Node problem than an ArangoDB problem.

child_process.execFile takes the name of an executable as well as an arguments array. Your arguments array currently looks like this:

['--server.database "my_db_name" run "/db" setup']

As far as I can tell that is the equivalent of passing the following argument on the command line:

"--server.database \"my_db_name\" run \"/db\" setup"

So what you actually want is probably this:

['--server.database', 'my_db_name', 'run', '/db', 'setup']
分享给朋友:
您可能感兴趣的文章:
随机阅读: