V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
sox

Runfile: Makefile 的 Node.js 版本

  •  2
     
  •   sox ·
    egoist · Oct 24, 2015 · 2383 views
    This topic created in 3850 days ago, the information mentioned may be changed or developed.

    造轮子混脸熟 :(

    用 shell.js 造的 Node.js 版本 Makefile

    GitHub 地址 | NPM

    举个 Runfile 栗子:

    var task = module.exports = {}
    
    task.clean = () => {
      rm('-rf', 'testFolder')
      rm('-rf', 'testSource')
    }
    
    // or run external tools
    task.deploy = (argv) => {
      var message = argv.m || 'update'
      exec('git add -A')
      exec(`git commit -m "${message}"`)
      exec('git push origin master')
    }
    
    task.default = ['clean', 'deploy']
    
    Supplement 1  ·  Oct 25, 2015

    大更新,借鉴了 Gulp:

    task.add('clean', () => {
      rm('-rf', 'testFolder')
      rm('-rf', 'testSource')
    })
    
    // or run external tools
    task.add('deploy', () => {
      var message = argv._[1] || 'update'
      exec('git add -A')
      exec(`git commit -m "${message}"`)
      exec('git push origin master')
    })
    
    task.add('default', ['clean', 'deploy'])
    
    Supplement 2  ·  Oct 26, 2015

    preview

    7 replies    2015-10-29 21:11:46 +08:00
    sox
        1
    sox  
    OP
       Oct 24, 2015
    @Livid V2EX 的 Markdown 渲染应该更新了 :(
    sox
        2
    sox  
    OP
       Oct 25, 2015
    大概长这样

    msg7086
        3
    msg7086  
       Oct 29, 2015
    stare
    英[stɛə] 美[stɛr]
    n. 凝视;注视;瞪眼
    v. 盯;凝视;注视
    词形变化: starer stared stared staring stares
    sox
        4
    sox  
    OP
       Oct 29, 2015 via Android
    @msg7086 蛤?
    msg7086
        5
    msg7086  
       Oct 29, 2015
    不是你自己写的 Staring 么
    sox
        6
    sox  
    OP
       Oct 29, 2015
    @msg7086 ...我觉得你直接说 line 10 少些了个 t 会比较容易懂 :)
    msg7086
        7
    msg7086  
       Oct 29, 2015
    盯着 'deploy' 看……

    其实还挺萌的。(?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2747 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:36 · PVG 23:36 · LAX 08:36 · JFK 11:36
    ♥ Do have faith in what you're doing.