Commit 8630264c authored by ransome1's avatar ransome1
Browse files

Fixed broken archive function when done file didn't exist...

Fixed broken archive function when done file didn't exist (https://github.com/ransome1/sleek/issues/400)
parent 8ed7a17e
{
"name": "sleek",
"productName": "sleek",
"version": "1.2.3-rc.1",
"version": "1.2.3-rc.2",
"description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"category": "ProjectManagement",
......
name: sleek
base: core18
version: "1.2.2"
version: "1.2.3"
summary: todo.txt manager for Linux, free and open-source (FOSS)
description: |
sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done.
......
......@@ -76,16 +76,18 @@ function getChannel() {
function getContent(file) {
try {
if(!file) return false;
// only continue if file has been passed and if it exists
if(!file || (file && !fs.existsSync(file))) return false
// only for MAS (Sandboxed)
// https://gist.github.com/ngehlert/74d5a26990811eed59c635e49134d669
const activeFile = getActiveFile();
if(process.mas) stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(activeFile[3])
if(process.mas) {
const activeFile = getActiveFile();
stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(activeFile[3])
}
return Promise.resolve(fs.readFileSync(file, {encoding: "utf-8"}, function(error, data) {
if(process.mas) stopAccessingSecurityScopedResource()
return data;
}));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment