imdone-core 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,9 +36,18 @@ export async function loadYamlConfig(filePath) {
36
36
  }
37
37
  return configLike
38
38
  }
39
+ export async function isImdoneProject(projectPath) {
40
+ const configPath = _path.join(projectPath, CONFIG_FILE_YML)
41
+ const configLike = await loadYamlConfig(configPath)
42
+ if (!configLike) return false
43
+ return true
44
+ }
39
45
 
40
46
  export async function findImdonePath(cwd) {
41
47
  const configDir = await findUp(CONFIG_DIR, { cwd, type: 'directory' })
48
+ if (!configDir) {
49
+ throw new Error(`Could not find imdone directory in ${cwd}`)
50
+ }
42
51
  return _path.dirname(configDir)
43
52
  }
44
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "imdone-core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,7 +55,7 @@
55
55
  "find-up-simple": "^1.0.1",
56
56
  "gray-matter": "^4.0.2",
57
57
  "ignore": "^5.2.0",
58
- "imdone-api": "^1.54.0",
58
+ "imdone-api": "^2.0.0",
59
59
  "isbinaryfile": "^5.0.4",
60
60
  "js-yaml": "^3.14.1",
61
61
  "json-fns": "^1.0.0",
@@ -2,5 +2,6 @@ export function load(projectPath: any, configPath?: string): Promise<Config | un
2
2
  export function save(config: any, projectPath: any): Promise<void>;
3
3
  export function loadForFilePath(filePath: any): Promise<Config | undefined>;
4
4
  export function loadYamlConfig(filePath: any): Promise<{} | undefined>;
5
+ export function isImdoneProject(projectPath: any): Promise<boolean>;
5
6
  export function findImdonePath(cwd: any): Promise<string>;
6
7
  import { Config } from '../../config.js';