Skip to content

Instantly share code, notes, and snippets.

@obonyojimmy
Forked from Loupax/assetPath.js
Last active June 20, 2020 18:37
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 obonyojimmy/85f2dd9a1d9a7bee371f7bbcdca50b57 to your computer and use it in GitHub Desktop.
Save obonyojimmy/85f2dd9a1d9a7bee371f7bbcdca50b57 to your computer and use it in GitHub Desktop.
A Meteor function that returns the path of the provided package asset
var getAssetPath = function getAssetPath(packageName, assetPath) {
assetPath = assetPath || '';
var meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../');
var assets_folder = meteor_root + '/server/assets/packages/'+packageName.replace(':','_')+'/'+assetPath;
return assets_folder;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment