Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
35
gaia/apps/ringtones/test/marionette/lib/sd_card.js
Executable file
35
gaia/apps/ringtones/test/marionette/lib/sd_card.js
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
/* jshint node: true*/
|
||||
/* exported injectTone */
|
||||
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
function injectTone(client, details) {
|
||||
var BASE_DIRS = {
|
||||
'ringtone': 'Ringtones',
|
||||
'alerttone': 'Notifications'
|
||||
};
|
||||
if (!(details.type in BASE_DIRS)) {
|
||||
throw new Error('tone type not supported: ' + details.type);
|
||||
}
|
||||
|
||||
var toneFolder = path.join(
|
||||
client.fileManager.deviceStorage.getDeviceStoragePath(),
|
||||
BASE_DIRS[details.type]
|
||||
);
|
||||
if (!fs.existsSync(toneFolder)) {
|
||||
fs.mkdirSync(toneFolder);
|
||||
}
|
||||
var musicFolder = path.join(toneFolder, 'music');
|
||||
if (!fs.existsSync(musicFolder)) {
|
||||
fs.mkdirSync(musicFolder);
|
||||
}
|
||||
client.fileManager.add([
|
||||
{ type: path.join(BASE_DIRS[details.type], 'music'),
|
||||
filePath: details.filePath, filename: details.filename }
|
||||
]);
|
||||
}
|
||||
|
||||
module.exports = {injectTone: injectTone};
|
||||
Loading…
Reference in a new issue