Skip to content
Permalink
Browse files

refactor(publisher): add deprecate method call to inform the user

  • Loading branch information
MarshallOfSound authored and malept committed Feb 5, 2017
1 parent 8572cad commit 24571197e7ed7b07a1f7d8f8342a77ef542061c6
Showing with 10 additions and 0 deletions.
  1. +2 −0 src/api/publish.js
  2. +8 −0 src/util/deprecate.js
@@ -1,6 +1,7 @@
import 'colors';

import asyncOra from '../util/ora-handler';
import deprecate from '../util/deprecate';
import getForgeConfig from '../util/forge-config';
import readPackageJSON from '../util/read-package-json';
import requireSearch from '../util/require-search';
@@ -60,6 +61,7 @@ export default async (providedOptions = {}) => {
publishTargets = forgeConfig.publish_targets[makeOptions.platform || process.platform];
} else if (typeof publishTargets === 'string') {
// FIXME(MarshallOfSound): Remove this fallback string typeof check in the next major bump
deprecate('publish target as a string').replaceWith('an array of publish targets');
publishTargets = [publishTargets];
}

@@ -0,0 +1,8 @@
import 'colors';
import logSymbols from 'log-symbols';

export default what => ({
replaceWith: (replacement) => {
console.warn(logSymbols.warning, `WARNING: ${what} is deprecated, please use ${replacement} instead`.yellow);
},
});

0 comments on commit 2457119

Please sign in to comment.
You can’t perform that action at this time.