Socket
Socket
Sign inDemoInstall

alfred-config

Package Overview
Dependencies
44
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.2.0

utils/workflow-data.js

12

cli.js

@@ -6,4 +6,2 @@ #!/usr/bin/env node

const pathExists = require('path-exists');
const resolveAlfredPrefs = require('resolve-alfred-prefs');
const readPkgUp = require('read-pkg-up');
const mkdirp = require('mkdirp');

@@ -13,7 +11,6 @@ const readConfig = require('./utils/read-config');

const textEditor = require('./utils/text-editor');
const workflowData = require('./utils/workflow-data');
const srcPath = path.join(process.cwd(), 'config.json');
console.log(process.cwd());
if (!pathExists.sync(srcPath)) {

@@ -26,8 +23,7 @@ // No `config.json` file found, gracefully exit because we don't need to merge

try {
const alfredPrefs = await resolveAlfredPrefs();
// Resolve the location of the workflow data
const workflowDataPath = await workflowData.resolvePath();
const {name} = readPkgUp.sync().package;
const destPath = path.join(workflowDataPath, 'user-config.json');
const destPath = path.join(path.dirname(alfredPrefs), 'Workflow Config', name, 'config.json');
// Read the current user workflow config and the original workflow config

@@ -34,0 +30,0 @@ const currentConfig = readConfig(destPath);

'use strict';
const path = require('path');
const dotProp = require('dot-prop');
const readPkgUp = require('read-pkg-up');
const readConfig = require('./utils/read-config');

@@ -11,10 +10,8 @@

constructor(options) {
const {name} = readPkgUp.sync().package;
const opts = {
cwd: path.join(path.dirname(getEnv('preferences')), 'Workflow Config', name),
cwd: path.join(path.dirname(getEnv('workflow_data')), 'user'),
...options
};
const configFile = path.join(opts.cwd, 'config.json');
const configFile = path.join(opts.cwd, 'user-config.json');

@@ -21,0 +18,0 @@ this.store = readConfig(configFile);

{
"name": "alfred-config",
"version": "0.1.1",
"version": "0.2.0",
"description": "Allow easy user configurations for your Alfred workflows",

@@ -42,4 +42,4 @@ "license": "MIT",

"path-exists": "^4.0.0",
"read-pkg-up": "^6.0.0",
"resolve-alfred-prefs": "^1.0.0"
"plist": "^3.0.1",
"resolve-alfred-prefs": "^2.0.0"
},

@@ -46,0 +46,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc