alfred-config
Advanced tools
Comparing version 0.1.1 to 0.2.0
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": { |
7492
10
131
5
+ Addedplist@^3.0.1
+ Added@xmldom/xmldom@0.8.10(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedplist@3.1.0(transitive)
+ Addedresolve-alfred-prefs@2.0.0(transitive)
+ Addedxmlbuilder@15.1.1(transitive)
- Removedread-pkg-up@^6.0.0
- Removed@babel/code-frame@7.24.7(transitive)
- Removed@babel/helper-validator-identifier@7.24.7(transitive)
- Removed@babel/highlight@7.24.7(transitive)
- Removed@types/normalize-package-data@2.4.4(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.13.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removedlines-and-columns@1.2.4(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedparse-json@5.2.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpicocolors@1.0.1(transitive)
- Removedread-pkg@5.2.0(transitive)
- Removedread-pkg-up@6.0.0(transitive)
- Removedresolve@1.22.8(transitive)
- Removedresolve-alfred-prefs@1.0.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.18(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtype-fest@0.5.20.6.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
Updatedresolve-alfred-prefs@^2.0.0