Skip to content

Instantly share code, notes, and snippets.

@juampynr
Created April 14, 2016 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juampynr/ecca1f3a4cece748f5f6a947eab2926c to your computer and use it in GitHub Desktop.
Save juampynr/ecca1f3a4cece748f5f6a947eab2926c to your computer and use it in GitHub Desktop.
diff --git a/moment.info.yml b/moment.info.yml
index 3f3d5be..89d4431 100644
--- a/moment.info.yml
+++ b/moment.info.yml
@@ -2,6 +2,4 @@ name: Moment.js
description: 'Integrate Moment.js library into Drupal.'
package: Libraries
core: 8.x
-dependencies:
- - system_stream_wrapper
type: module
diff --git a/moment.install b/moment.install
index 4fa0309..64a46bf 100644
--- a/moment.install
+++ b/moment.install
@@ -21,7 +21,10 @@ function moment_requirements($phase) {
$library = $d->getLibraryByName('moment', $name);
$severity = REQUIREMENT_OK;
foreach ($library['js'] as $js) {
- if (!file_exists($js['data'])) {
+ try {
+ file_exists($js['data']);
+ }
+ catch (\InvalidArgumentException $e) {
$severity = REQUIREMENT_ERROR;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment