本篇文章给大家谈谈仿墨灵音乐网站源码分享,以及m墨灵音乐对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。
varreadline=require(&34;)\nvarpath=require(&34;)\nconst{existsSync,symlinkSync,lstatSync,fstatSync}=require(&34;)\nvarbaseDir=process.cwd()\n\nasyncfunctionrun(){\nconsole.log(&34;+baseDir)\nconstrl=readline.createInterface({\ninput:process.stdin,\noutput:process.stdout,\n})\nconstquestion=promisfy(rl.question).bind(rl)\ntry{\nwhile(true){\nvarsourcePath\nvarlinkPath\nwhile(true){\nsourcePath=awaitquestion(&34;)\nif(sourcePath===&34;){\nconsole.log(&34;)\ncontinue\n}\nif(!path.isAbsolute(sourcePath)){\nsourcePath=path.join(baseDir,sourcePath)\n}\nif(!existsSync(sourcePath)){\nconsole.log(`fileNOTExist${sourcePath}`)\ncontinue\n}else{\nbreak\n}\n}\nwhile(true){\nlinkPath=awaitquestion(&34;)\nif(linkPath===&34;){\ncontinue\n}\nif(!path.isAbsolute(linkPath)){\nlinkPath=path.join(baseDir,linkPath)\n}\n\nvardir=path.dirname(linkPath)\nif(!existsSync(dir)){\nconsole.log(&34;)\ncontinue\n}\n//varstat=lstatSync(linkPath)\n//console.log([dir,linkPath])\nif(existsSync(linkPath)&&lstatSync(linkPath).isDirectory()){\nlinkPath=path.join(linkPath,path.basename(sourcePath))\nconsole.log(&34;+linkPath)\n}\nif(existsSync(linkPath)){\nconsole.log(&34;)\ncontinue\n}\nbreak\n}\nconsole.log(`syms${sourcePath}==>${linkPath}`)\nsymlinkSync(sourcePath,linkPath)\n}\n}catch(err){\nconsole.error(err)\nprocess.exit(1)\n}\n}\n\n/**\n*@templateT,Arg\n*@param{function(…args:Arg[],function(T):void)}func\n*@returns{function(…args:Arg[]):Promise<T>}\n*/\nfunctionpromisfy(func){\nreturnfunction(…args){\nreturnnewPromise((resolve,rej)=>{\nfunc.call(this,…args,resolve)\n})\n}\n}\nrun()\n
源码地址:
https://github.com/spiritwindy/AllShell/tree/mhistroy
OK,关于仿墨灵音乐网站源码分享和m墨灵音乐的内容到此结束了,希望对大家有所帮助。
