Socket
Socket
Sign inDemoInstall

google-font-installer

Package Overview
Dependencies
38
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

2

cli.js

@@ -10,3 +10,3 @@ #!/usr/bin/env node

var pjson = require('./package.json');
var ncp = require("copy-paste");
var ncp = require("copy-paste-win32fix");

@@ -13,0 +13,0 @@ program

@@ -87,3 +87,3 @@ 'use strict'

if (message.length > 256 && !self._fisrtBytes){
self._mimeType = fileType(new Buffer(message));
self._mimeType = fileType(new Buffer.from(message));
self._fisrtBytes = true;

@@ -90,0 +90,0 @@ }

@@ -11,5 +11,10 @@ 'use strict'

const platform = os.platform();
const tmpdir = process.env.TRAVIS ? process.env.TRAVIS_BUILD_DIR : os.tmpdir();
const tmp_folder = path.join(tmpdir, 'google-font-installer');
if (platform === 'win32') {
var PowerShell = require('node-powershell');
}
function SystemFont() {}

@@ -19,3 +24,3 @@

if (!remoteFile) {
callback(new Error('Nothig to download'), null);
callback(new Error('Nothing to download'), null);
return;

@@ -115,3 +120,3 @@ }

SystemFont.prototype.install = function(remoteFile, fileName, callback) {
switch (os.platform()) {
switch (platform) {
case 'linux':

@@ -131,6 +136,32 @@ var destFolder = path.join(os.homedir(), '.fonts/');

}
child_process.exec('cscript.exe ' + path.join(__dirname, 'windows', 'installFont.js') + ' ' + tmpPath, function(err, stdout, stderr){
callback(err, 'Font System Folder with cscript.');
})
})
var ver = os.release().split('.');
var majorVer = 0;
if (ver.length >= 1) {
majorVer = parseInt(ver[0], 10);
}
if (majorVer >= 6) {
var ps = new PowerShell({
executionPolicy: 'Bypass',
noProfile: true
});
ps.addCommand('$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14)');
ps.addCommand(`Get-ChildItem -Path "${tmpPath}" -Recurse -include *.ttf | % { $fonts.CopyHere($_.fullname) }`)
ps.invoke()
.then(function(output) {
ps.dispose();
callback(null, 'Font System Folder with Powershell.');
})
.catch(function(err) {
ps.dispose();
callback(err);
});
}
else {
child_process.exec('cscript.exe ' + path.join(__dirname, 'windows', 'installFont.js') + ' ' + tmpPath, function(err, stdout, stderr){
callback(err, 'Font System Folder with cscript.');
})
}
})
break;

@@ -137,0 +168,0 @@ default:

{
"name": "google-font-installer",
"version": "1.1.0",
"version": "1.2.0",
"description": "Download and install Google Web Fonts on your local machine",

@@ -29,7 +29,10 @@ "author": "Lorenzo Zottar <lordgiotto@gmail.com>",

"commander": "^2.9.0",
"copy-paste": "^1.3.0",
"copy-paste-win32fix": "^1.4.0",
"file-type": "^3.6.0",
"mv": "^2.1.1",
"pascal-case": "^1.1.2"
},
"optionalDependencies": {
"node-powershell": "^4.0.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc