How to use the ospath.data function in ospath

To help you get started, we’ve selected a few ospath examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github w3f / polkadot-deployer / test / lib / core / files.js View on Github external
it('should return the deployments path', () => {
      const expected = path.join(ospath.data(), 'polkadot-deployer', 'deployments');

      const subject = new Files();
      subject.deploymentsPath().should.equal(expected);
    });
  });
github alex-saunders / glicky / src / server / eventHandlers / settings / settings.js View on Github external
getProjectDataDirectory() {
    const dataPath = ospath.data();
    const projectDataPath = path.join(dataPath, 'Glicky');

    if (!fs.existsSync(projectDataPath)) {
      fs.mkdirSync(projectDataPath);
    }

    return projectDataPath;
  }
github w3f / polkadot-deployer / lib / core / files.js View on Github external
constructor(config={}) {
    this.config = JSON.parse(JSON.stringify(config));
    if(!this.config.dataPath) {
      this.config.dataPath = ospath.data();
    } else {
      this.config.dataPath = path.normalize(this.config.dataPath);
      if (this.config.dataPath === '.') {
        this.config.dataPath = process.cwd();
      }
    }
  }
github cypress-io / cypress / packages / server / lib / util / app_data.js View on Github external
* DS102: Remove unnecessary code created because of implicit returns
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
const os = require('os')
const path = require('path')
const ospath = require('ospath')
const Promise = require('bluebird')
const la = require('lazy-ass')
const check = require('check-more-types')
const log = require('debug')('cypress:server:appdata')
const pkg = require('@packages/root')
const fs = require('../util/fs')
const cwd = require('../cwd')

const PRODUCT_NAME = pkg.productName || pkg.name
const OS_DATA_PATH = ospath.data()

const ELECTRON_APP_DATA_PATH = path.join(OS_DATA_PATH, PRODUCT_NAME)

if (!PRODUCT_NAME) {
  throw new Error('Root package is missing name')
}

const getSymlinkType = function () {
  if (os.platform() === 'win32') {
    return 'junction'
  }

  return 'dir'
}

const isProduction = () => {
github ajaysreedhar / kongdash / src / main.js View on Github external
'use strict';

const APP_NAME = 'KongDash';
const VERSION = '0.3.0';

const electron  = require('electron');
const path      = require('path');
const ospath = require('ospath');
const jsonfile  = require('jsonfile');

let absPath = path.dirname(__dirname), configFile = ospath.data() + '/' + APP_NAME + '/config.json';
let {app, ipcMain, BrowserWindow, Menu} = electron;
let mainWindow, appConfig = {kong: {}, app: {enableAnimation: true}};

let startMainWindow = function () {
    mainWindow = new BrowserWindow({
        backgroundColor: '#1A242D',
        width: 1100,
        height: 580,
        center: true,
        title: app.getName(),
        minHeight: 500,
        minWidth: 900,
        icon: absPath + '/kongdash-256x256.png'
    });
    mainWindow.loadURL('file://' + absPath + '/src/initialize.html');

ospath

Operating system specific paths.

MIT
Latest version published 8 years ago

Package Health Score

65 / 100
Full package analysis

Popular ospath functions