 read = (fname, encoding="utf8") -> fs.readFileSync(fname, encoding)
 exists = path.existsSync
 join = path.join
+pathSep = path.normalize("/")
 argv = null
 
 usage = """node $0 [-l] install

      commands.install()
    if not exists join(staticDirName, "components", componentName())
      commands.install()
      installTo join(staticDirName, "components"), true
    tests = discoverTests staticDirName
    extraHtml = getTestTemplate() + "\n" + stringBundlesAsRequirejsModule()
    testServer


provide = (pth) ->
  if not exists pth
    _.reduce [""].concat(pth.split(pathSep)), (soFar, dir) ->
      if not exists(join(soFar, dir))
        fs.mkdirSync join(soFar, dir)
      soFar += (if soFar then pathSep else "") + dir

discoverTests = (dir) ->
  dir ||= if isComponent() then join(testDirectory(), "static") else "static"
