mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Remove old style package support
All packages have been migrated to the new style.
This commit is contained in:
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user