Skip to content

Commit

Permalink
Modernize bin script
Browse files Browse the repository at this point in the history
  • Loading branch information
heikkipora committed Nov 25, 2023
1 parent f7c32e3 commit bf5da47
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 0 additions & 6 deletions bin/gitlab-radiator

This file was deleted.

6 changes: 6 additions & 0 deletions bin/gitlab-radiator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env node

process.env.NODE_ENV = 'production'

const {runUpdate} = await import('../src/app.js')
await runUpdate()
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": "4.1.1",
"license": "MIT",
"bin": {
"gitlab-radiator": "bin/gitlab-radiator"
"gitlab-radiator": "bin/gitlab-radiator.js"
},
"scripts": {
"build": "./build-npm",
Expand Down
4 changes: 1 addition & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ socketIoServer.on('connection', (socket) => {
socket.emit('state', withDate(globalState))
})

async function runUpdate() {
export async function runUpdate() {
try {
globalState.projects = await update(config)
globalState.error = await errorIfRunnerOffline()
Expand Down Expand Up @@ -74,8 +74,6 @@ async function errorIfRunnerOffline() {
return null
}

runUpdate()

function withDate(state) {
return {
...state,
Expand Down

0 comments on commit bf5da47

Please sign in to comment.