Case sensetive move
This commit is contained in:
25
output.js
Normal file
25
output.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const fs = require('fs')
|
||||
|
||||
class Output {
|
||||
constructor () {
|
||||
this.content = ''
|
||||
}
|
||||
|
||||
addLine (text) {
|
||||
this.content += text + '\n'
|
||||
}
|
||||
|
||||
submit () {
|
||||
const filename = 'index.txt'
|
||||
|
||||
try {
|
||||
fs.unlinkSync(filename)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.log('File probably doesnt exist')
|
||||
}
|
||||
fs.writeFileSync(filename, this.content)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Output()
|
||||
Reference in New Issue
Block a user