[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets #100

Merged
merged 13 commits into from
Jul 8, 2024
Merged
Prev Previous commit
Next Next commit
try
  • Loading branch information
mariusandra committed Jul 8, 2024
commit 222c81919bc0c003f9a72e38e41c473992ad73d3
6 changes: 3 additions & 3 deletions frameos/src/frameos/apps.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ proc logError*(self: AppRoot, message: string) =
"error": message
})

proc cleanPosix*(self: string): string =
proc cleanFilename*(self: string): string =
var finalResult = ""
var lastCharWasSpace = false

Expand All @@ -63,8 +63,8 @@ proc saveAsset*(self: AppRoot, filename: string, contents: string, isAuto: bool)
return ""

let assetsPath = if self.frameConfig.assetsPath == "": "/srv/assets" else: self.frameConfig.assetsPath
let appName = if self.nodeName == "": "saved" else: self.nodeName.replace("data/", "").cleanPosix
let basename = filename.splitFile.name.cleanPosix
let appName = if self.nodeName == "": "saved" else: self.nodeName.replace("data/", "").cleanFilename()
let basename = filename.splitFile.name.cleanFilename()
let md5hash = getMD5(contents)
let extension = filename.splitFile.ext
let cleanPath = &"{assetsPath}/{appName}"
Expand Down
2 changes: 1 addition & 1 deletion frameos/src/frameos/utils/system.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import posix

proc getAvailableDiskSpace*(path: string): int =
proc getAvailableDiskSpace*(path: string): int64 =
let fd = open(path.cstring, O_RDONLY)
if fd >= 0:
try:
Expand Down
Loading