mirror of
https://github.com/atom/atom.git
synced 2026-02-05 20:25:04 -05:00
27 lines
472 B
CoffeeScript
27 lines
472 B
CoffeeScript
fsUtils = require 'fs-utils'
|
|
|
|
###
|
|
# Internal #
|
|
###
|
|
module.exports =
|
|
class Package
|
|
@build: (path) ->
|
|
TextMatePackage = require 'text-mate-package'
|
|
AtomPackage = require 'atom-package'
|
|
|
|
if TextMatePackage.testName(path)
|
|
new TextMatePackage(path)
|
|
else
|
|
new AtomPackage(path)
|
|
|
|
@load: (path, options) ->
|
|
pack = @build(path)
|
|
pack.load(options)
|
|
pack
|
|
|
|
name: null
|
|
path: null
|
|
|
|
constructor: (@path) ->
|
|
@name = fsUtils.base(@path)
|