Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async GetDrives4(): Promise {
const drives = await drivelist.list();
return drives;
// const list:DiskInfoItem[] = []
// for(const drive of drives){
// const item:DiskInfoItem = {
// capacity:item.
// }
// }
}
IsReady: boolean;
static async GetDrives4() {
const drives = await drivelist.list();
return drives;
// const list:DiskInfoItem[] = []
// for(const drive of drives){
// const item:DiskInfoItem = {
// capacity:item.
// }
// }
}
}
function checkForSD() {
if (!sdCardCallback) return;
const drivelist = require('drivelist');
drivelist.list(function(error, disks) {
if (error) throw error;
console.log({disks});
disks.forEach(function (disk) {
if (disk.mountpoint) {
const mountpoints = disk.mountpoint.split(',');
mountpoints.forEach(function (mountpoint) {
const sentinel = path.join(mountpoint, '.tingbot');
fs.exists(sentinel, function (exists) {
if (exists) {
if (!sdCardCallback) return;
sdCardCallback(mountpoint);
stopLookingForSD();
return function(dispatch: Function, getState: Function) {
drivelist.list((error, drives) => {
if (error) {
throw error;
}
dispatch(drivesSet(drives));
});
driveScanner = new DrivelistWatcher({
callbackDeviceAdded: drives => {
dispatch(drivesSet(drives));
},
callbackDeviceRemoved: drives => {
dispatch(drivesSet(drives));
},
intervalTime: 5000
});
};
function getSDs (cb) {
drivelist.list(function (error, drives) {
if (error) {
cb(error, false)
return
}
var sdCards = []
for (var i = 0; i < drives.length; i++) {
var currentDrive = drives[i]
if (!currentDrive.system && !currentDrive.protected) {
currentDrive.name = getDriveName(currentDrive)
if (currentDrive.name) {
sdCards.push(currentDrive)
}
}
}
getSelectedDevices (paths, callback) {
debug('state:device-select', paths)
drivelist.list((error, drives) => {
debug('state:device-select', paths, error ? 'NOT OK' : 'OK')
if (error) {
callback.call(this, error)
return
}
const results = paths.map((path) => {
const destination = {
fd: null,
error: null,
stream: null,
finished: false,
verified: false,
device: _.find(drives, {
device: path