Skip to content

Commit

Permalink
fixed some stuff on devdex
Browse files Browse the repository at this point in the history
  • Loading branch information
ForwardFeed committed Sep 23, 2024
1 parent 050cdc8 commit e525e7c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions devDexServer/config_template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const config: Config = {
hostname: "localhost",
protocol: "http",
projectName: "eliteredux", //care to put well that into the .gitignore
token: "You token",
version: "Latest",
token: "",
version: "2.1",
remote: {
owner: "Elite-Redux",
repo: "eliteredux-source",
Expand Down
2 changes: 1 addition & 1 deletion devDexServer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { fetchChanges, initGitRepoIfDoesNotExist, setRemoteUrl } from "./src/git
import { updateData } from "./src/nextdex_controls.js";

initGitRepoIfDoesNotExist(function(){
setRemoteUrl(fetchChanges)
fetchChanges()
startServer()
})
9 changes: 5 additions & 4 deletions devDexServer/src/git_control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import file_list from "./file_list.js";

const folderPath = path.join('./', config.projectName)

export function setRemoteUrl(callback = ()=>{}){
const cmdSetRemote = `git remote set-url origin https://${config.token}@github.com/${config.remote.owner}/${config.remote.repo}`
export function setRemoteUrl(callback: ()=> void){
const cmdSetRemote = `git remote set-url origin https://${config.token}@github.com/${config.remote.owner}/${config.remote.repo} &&\
git config --global http.sslVerify false`
console.log(`Running ${cmdSetRemote}`)
exec(cmdSetRemote, {cwd: folderPath}, (err, stdout, stderr)=>{
if (stdout) console.log('STDOUT: ', stdout)
Expand All @@ -29,7 +30,7 @@ export function initGitRepoIfDoesNotExist(callback: ()=> void){
callback()
} else {
console.log(`Repository does not exist, initializing it`)
cloneRepository(callback)
cloneRepository((()=>{setRemoteUrl(callback)}))
}


Expand All @@ -47,7 +48,7 @@ function cloneRepository(callback: ()=> void){
console.error(`Failed when initing git in the subfolder \nerror:`, err)
return
}
setRemoteUrl(callback)
callback()
})
}

Expand Down
2 changes: 1 addition & 1 deletion devDexServer/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function startServer(){
addRoutes(app)
const staticPath = path.join(__dirname, '../../../static')
console.log(`Preparing static files from ${staticPath} on /`)
app.use("/", express.static(staticPath))
app.use("/", express.static(staticPath, {etag: false}))
console.log('Initialize listening')
app.listen(config.port, ()=>{
console.log(`Listening on port ${config.protocol}:/${config.hostname}:${config.port}/`)
Expand Down

0 comments on commit e525e7c

Please sign in to comment.