Remove old style package support

All packages have been migrated to the new style.
This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-02-08 11:59:30 -08:00
parent db257e1811
commit 659c6bbd56

View File

@@ -1,5 +1,4 @@
fs = require 'fs'
_ = require 'underscore'
module.exports =
class Package
@@ -7,25 +6,13 @@ class Package
TextMatePackage = require 'text-mate-package'
AtomPackage = require 'atom-package'
oldStylePackage = _.find fs.list(path), (filePath) =>
/index\.coffee$/.test filePath
if TextMatePackage.testName(path)
new TextMatePackage(path)
else
if not oldStylePackage
new AtomPackage(path)
else
try
PackageClass = require path
new PackageClass(path) if typeof PackageClass is 'function'
catch e
console.warn "Failed to load package at '#{path}'", e.stack
new AtomPackage(path)
name: null
path: null
constructor: (@path) ->
@name = fs.base(@path)
activate: (rootView) ->