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

Fix issues with paths when using windows #33

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/engine/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
*/

const _ = require('lodash');
const path = require('path');
const Bluebird = require('bluebird');
const imagefs = require('resin-image-fs');
const formats = require('./formats');

// Use POSIX paths everywhere, not your local OS format
const path = require('path').posix;

/**
* @summary Check if a file declaration represents a virtual file
* @function
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/write.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ ava.test('should be able to modify a fileset', (test) => {
cellular: imagefs.readFile({
image: image,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'cellular')
path: path.posix.join(schema.files.system_connections.location.path, 'cellular')
}),
ethernet: imagefs.readFile({
image: image,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'ethernet')
path: path.posix.join(schema.files.system_connections.location.path, 'ethernet')
}),
wifi: imagefs.readFile({
image: image,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'wifi')
path: path.posix.join(schema.files.system_connections.location.path, 'wifi')
})
});
};
Expand Down Expand Up @@ -181,17 +181,17 @@ ava.test('should not override custom properties inside a fileset', (test) => {
cellular: imagefs.readFile({
image: image,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'cellular')
path: path.posix.join(schema.files.system_connections.location.path, 'cellular')
}),
ethernet: imagefs.readFile({
image: image,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'ethernet')
path: path.posix.join(schema.files.system_connections.location.path, 'ethernet')
}),
wifi: imagefs.readFile({
image: image,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'wifi')
path: path.posix.join(schema.files.system_connections.location.path, 'wifi')
})
});
};
Expand All @@ -200,7 +200,7 @@ ava.test('should not override custom properties inside a fileset', (test) => {
return imagefs.writeFile({
image: imagePath,
partition: schema.files.system_connections.location.partition,
path: path.join(schema.files.system_connections.location.path, 'cellular')
path: path.posix.join(schema.files.system_connections.location.path, 'cellular')
}, '[connection]\nname=cellular\nfoo=bar\nbar=baz').then(() => {
return reconfix.writeConfiguration(schema, {
cellularConnectionName: 'newcellular',
Expand Down