Skip to content

Commit

Permalink
Add warning file to nextcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
RadCod3 committed Mar 2, 2024
1 parent 4bef8aa commit 59167b3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/lib/SyncTargetNextcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ class SyncTargetNextcloud extends BaseSyncTarget {

fileApi.setLogger(this.logger());

// Check if server has editWarningFile
const editWarningFile = { 'name': '_⚠️_IMPORTANT_READ_FIRST_⚠️_.md', 'content': 'WARNING DO NOT EDIT ANY MARKDOWN FILE' };
const response = await fileApi.get(editWarningFile.name);
if (!response) {
this.logger().info('Nextcloud: Missing edit warning file... adding it');
await fileApi.put(editWarningFile.name, editWarningFile.content);
} else if (response !== editWarningFile.content) {
this.logger().info('Nextcloud: Edit warning file has wrong content... updating it');
await fileApi.put(editWarningFile.name, editWarningFile.content);
} else {
this.logger().info('Nextcloud: Edit warning file is present and has the correct content');
}
return fileApi;
}

Expand Down

0 comments on commit 59167b3

Please sign in to comment.