fix(migrations): Remove unexpected shell call

This patch removes the call of `/usr/bin/env` when calling the migration
script in favour of using the processes own nodejs invocation path.

This should drop the requirement for `/usr/bin/env` to exist on a
system/in a container that runs hedgedoc.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
Sheogorath 2022-05-04 02:24:47 +02:00 committed by David Mehren
parent b11c768bd8
commit dd539273fb
2 changed files with 4 additions and 1 deletions

View file

@ -3,7 +3,7 @@ const { spawnSync } = require('child_process')
const path = require('path')
module.exports = {
up: function (queryInterface, Sequelize) {
const cleanup = spawnSync('./bin/cleanup', { cwd: path.resolve(__dirname, '../../') })
const cleanup = spawnSync(process.argv[0], ['./bin/cleanup'], { cwd: path.resolve(__dirname, '../../') })
if (cleanup.status !== 0) {
throw new Error('Unable to cleanup')
}