shell-ahk
Version:
`Lodash`/`jQuery` for `AHK`.
42 lines (32 loc) • 1.1 kB
text/coffeescript
# -check
import fileShell_replace from './replace'
import fileShell_noop from './noop'
class FileShell
###* import('./fileShell').Constructor ###
constructor: (source) ->
###* import('./fileShell').FileShell['source'] ###
= source
###* import('./fileShell').FileShell['append'] ###
append: (content) ->
fileShell_noop content
Native 'FileAppend, % content, % this.source, UTF-8'
return
###* import('./fileShell').FileShell['isExists'] ###
isExists: -> FileExist
###* import('./fileShell').FileShell['read'] ###
read: ->
unless then return ''
fileShell_result = ''
Native 'FileRead, fileShell_result, % this.source'
return fileShell_replace fileShell_result, '\r', ''
###* import('./fileShell').FileShell['remove'] ###
remove: ->
unless then return
Native 'FileDelete, % this.source'
return
###* import('./fileShell').FileShell['write'] ###
write: (content) ->
content
return
fileShell_noop FileShell