Files

1 line
869 B
JavaScript
Raw Permalink Normal View History

2026-03-22 03:21:45 +02:00
"use strict";function r(r){return"string"==typeof r?n.resolve(process.cwd(),r):process.cwd()}function e(e,o){e=r(e),t.lstat(e,function(r,i){return r?-2===r.errno?void o(new Error("No folder exists at "+e)):void o(r):i.isDirectory()===!1?void o(new Error(""+e+" is a file not a directory")):void t.readFile(n.resolve(e,"package.json"),"utf8",function(r,n){if(r)return-2===r.errno?void o(new Error("No 'package.json' exists at "+e+"/package.json")):void o(r);var t=void 0;try{t=JSON.parse(n)}catch(i){return void o(new Error("Error parsing skill's 'package.json' at "+e+"/package.json"))}if("string"!=typeof t.name&&0!==t.name.length)return void o(new Error('Skill hasn\'t properly set the "name" field in '+e+"/package.json"));var a=t.name;o(null,e,a)})})}var o=function(r){return r&&r.__esModule?r["default"]:r},n=o(require("path")),t=o(require("fs"));module.exports=e;