Fix Windows build

The script parts in package.json are platform dependent and the
bash if syntax does not work on Windows.