pkg-fetch/lib/chmod.js
2016-10-04 12:33:05 +03:00

10 lines
260 B
JavaScript

import { chmod, stat } from 'fs-promise';
export async function plusx (file) {
const s = await stat(file);
const newMode = s.mode | 64 | 8 | 1;
if (s.mode === newMode) return;
const base8 = newMode.toString(8).slice(-3);
await chmod(file, base8);
}