当前位置: 首页 > news >正文

做视频解析网站违法不网站绝对路径301

做视频解析网站违法不,网站绝对路径301,专业商城网站搭建价格,华东建设安装有限公司网站一、项目背景 一份代码#xff0c;发布多个小程序。想让技术支持部通过脚本自己获取代码#xff0c;并通过脚本自动提交到客户的小程序后台。他们自行发布。 现已注册第三方平台#xff0c;开发人员通过“开发小程序”上传模板。开发人员把代码上传到模板#xff0c;支持…一、项目背景 一份代码发布多个小程序。想让技术支持部通过脚本自己获取代码并通过脚本自动提交到客户的小程序后台。他们自行发布。 现已注册第三方平台开发人员通过“开发小程序”上传模板。开发人员把代码上传到模板支持人员选择模板进行发布小程序。好像git代码管理也不需要了。 二、主要代码 app.js const express require(express); const fs require(fs); const simpleGit require(simple-git); const cors require(cors); // 引入 cors 模块const app express();const gitUrl xxx; //配置 const branch 5.0.1; const codePath unpackage/dist/build/mp-weixin;// 本地临时文件夹 const tempFolder temp;// 使用 cors 中间件 app.use(cors());//clone项目 app.get(/api/gitClone, (req, res) {simpleGit().clone(gitUrl, tempFolder, [-b, branch], (err, data) {if (err) {console.error(Clone failed:, err);} else {console.log(Clone success);res.json({message: clone成功});// 2. 复制代码到指定路径// 这里可能需要根据你的实际需求使用适当的文件复制方法// 例如使用 fs-extra 库的 copy 方法// 3. 执行特定文件const filePath ${tempFolder}/${codePath}/your-executable-file.js;try {// execSync(node ${filePath}, {// stdio: inherit// });console.log(Execution success);} catch (error) {console.error(Execution failed:, error);}}}); });//git 获取所有分支 app.get(/api/gitBranches, (req, res) {// 获取所有分支simpleGit(tempFolder).branch((err, branchSummary) {console.log(branchSummary: , branchSummary);if (err) {console.error(Error:, err);res.status(500).json({error: Failed to fetch branches});} else {// 将分支信息转换为 JSON 格式并返回const branchesJson {branches: branchSummary.all};// current: 5.0.1, 返回的字段为当前分支//{branches:[5.0.1,remotes/origin/1.0.0,remotes/origin/2.0.0,remotes/origin/2.0.1,remotes/origin/2.0.2,remotes/origin/3.0.0,remotes/origin/4.0.0,remotes/origin/4.1.0,remotes/origin/4.2.0,remotes/origin/4.2.1,remotes/origin/5.0.1,remotes/origin/6.0.0,remotes/origin/master]}res.json(branchesJson);}}); });//git 切换分支 app.get(/api/checkoutBranch, (req, res) {// 获取所有分支simpleGit(tempFolder).checkout(6.0.0, (err) {if (err) {console.error(Error:, err);} else {console.log(Switched to branch 6.0.0);res.json({message: 切换成功});}}); });const branchToPull 6.0.0; // 要拉取的分支名称//git 拉取指定分支代码 app.get(/api/pull, (req, res) {// 获取所有分支// 拉取分支代码simpleGit(tempFolder).pull(origin, branchToPull, (err, update) {if (err) {console.error(Error:, err);res.json({message: 拉取错误});} else if (update update.summary.changes) {console.log(Pulled ${update.summary.changes} changes from branch ${branchToPull});res.json({message: 最新成功});} else {console.log(Already up to date);res.json({message: 已经是最新});}}); });app.listen(8000, () {console.log(Server is running on port 8000); });
http://www.dnsts.com.cn/news/83829.html

相关文章:

  • 张家界建设信息网站湖南的商城网站建设
  • 云南网站建设优选平台关于建设工程的网站
  • 巨鹿网站建设多少钱php 7.0 wordpress
  • 好的产品设计网站静态网页html模板
  • 衡水网站建设选哪家公司简介模板怎么做
  • wordpress动漫二次元主题苏州seo快速优化
  • 惠州 企业网站建设wordpress付费商业站
  • 房产局网站建设方案深圳做个商城网站设计
  • 北海住房和城乡建设部网站模板网站什么意思
  • 撤销个人网站备案不关站备案wordpress 2019
  • 微信做网站网站泰安网站建设介绍
  • WordPress瀑布流图片站邯郸教育平台网站建设
  • 织梦系统做的网站打开慢wordpress template
  • 如何做网站评估分析网页托管平台排名
  • 网站营销外包公司河北建设厅官方网站
  • 营销型网站建设比较好人工智能网站建设
  • 大连科技网站制作wordpress手机分享插件下载地址
  • 做线下活动的网站免费的行情网站app软件大全
  • 国外知名设计网站成都餐饮设计公司有哪些
  • 外贸企业网站红色风格买东西网站
  • 如何开心设计一个网站ps做网站导航条高度
  • 东莞网站建设推广有哪些聊城医院网站建设
  • 如何上传网站到空间网站标签怎么设置
  • 模板建站优点怎么卸载windows优化大师
  • 网站做短链统计优缺点智慧新零售系统
  • 网站建设服务图片网站开发运行环境怎么写
  • 企业网站怎么做毕业设计展厅设计平面布置图
  • 销售一个产品的网站怎么做的简易网站制作
  • 宁波建设工程报名网站wordpress连接微博 破解
  • 昆山外贸网站建设推广logo设计在线生成 免费