Skip to content

Commit

Permalink
Merge pull request #192 from muffinista/point-to-system-savers
Browse files Browse the repository at this point in the history
Use proper paths so system savers get picked up #190
  • Loading branch information
muffinista authored Mar 9, 2024
2 parents b829677 + a7175d0 commit c8bb675
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/lib/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class SaverPrefs {
}

this.systemSource = path.join(this.rootDir, "system-savers");

this.confOpts = {
schema: DEFAULTS,
clearInvalidConfig: true,
Expand Down
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ var bootApp = async function() {
saversDir = path.join(process.resourcesPath, "savers");
}

const systemDir = path.join(getSystemDir(), "system-savers");
const systemDir = getSystemDir();

let basePath;
// store our root path as a global variable so we can access it from screens
Expand Down
Binary file modified test/fixtures/test-savers.zip
Binary file not shown.
16 changes: 16 additions & 0 deletions test/lib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ describe("Package", function() {
});

it("unzips files", function(done) {
if (process.platform == "darwin") {
this.skip();
}

p.zipToSavers(zipPath).then(() => {
var testDest = path.resolve(workingDir, "sparks", "index.html");
assert(fs.existsSync(testDest));
Expand All @@ -157,6 +161,10 @@ describe("Package", function() {
});

it("recovers from errors", function(done) {
if (process.platform == "darwin") {
this.skip();
}

p.zipToSavers(dataPath).
then(() => {}).
catch( () => {
Expand All @@ -165,6 +173,10 @@ describe("Package", function() {
});

it("keeps files on failure", function(done) {
if (process.platform == "darwin") {
this.skip();
}

helpers.addSaver(workingDir, "saver-one", "saver.json");

var testDest = path.resolve(workingDir, "saver-one", "saver.json");
Expand All @@ -178,6 +190,10 @@ describe("Package", function() {


it("removes files that arent needed", function(done) {
if (process.platform == "darwin") {
this.skip();
}

helpers.addSaver(workingDir, "saver-one", "saver.json");

var testDest = path.resolve(workingDir, "saver-one", "saver.json");
Expand Down
2 changes: 1 addition & 1 deletion test/main/power.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("Power", function() {

describe("unhandled platform", function() {
it("works", async function() {
const power = new Power("beos");
const power = new Power({platform: "beos"});
assert(await power.charging());
});
});
Expand Down

0 comments on commit c8bb675

Please sign in to comment.