Browse Source

Fix scripts.

primary
CismonX 8 months ago
parent
commit
8dcde6fdaa
Signed by: CismonX GPG Key ID: 3094873E29A482FB
  1. 23
      ext/html-preview.pm
  2. 2
      scripts/make-vsix.js
  3. 5
      scripts/package.sh

23
ext/html-preview.pm

@ -21,23 +21,20 @@
use strict;
sub vscode_convert_texinfo_image_uri {
sub vscode_convert_image_uri {
my ( $self, $cmdname, $command, $args ) = @_;
my $filename = $args->[0]->{'monospacetext'};
if ( defined($filename)
&& rindex( $filename, 'http://', 0 ) == -1
&& rindex( $filename, 'https://', 0 ) == -1 )
{
$self->set_conf( 'IMAGE_LINK_PREFIX',
$self->{'parser'}->{'values'}->{'__vscode_texinfo_image_uri_base'}
);
}
return &{ $self->default_commands_conversion($cmdname) }
( $self, $cmdname, $command, $args );
my $prefix
= ( defined($filename)
&& rindex( $filename, 'http://', 0 ) == -1
&& rindex( $filename, 'https://', 0 ) == -1 )
? $self->{'parser'}->{'values'}->{'__vscode_texinfo_image_uri_base'}
: undef;
$self->set_conf( 'IMAGE_LINK_PREFIX', $prefix );
return &{ $self->default_commands_conversion($cmdname) }(@_);
}
texinfo_register_command_formatting( 'image',
\&vscode_convert_texinfo_image_uri );
texinfo_register_command_formatting( 'image', \&vscode_convert_image_uri );
1;

2
scripts/make-vsix.js

@ -6,7 +6,7 @@
* this notice are preserved. This file is offered as-is, without any warranty.
*/
const fs = require('fs')
const fs = require('fs');
const yazl = require('yazl');
async function addPathToZipFile(zipFile, path) {

5
scripts/package.sh

@ -19,10 +19,11 @@ minify-xml --output extension.vsixmanifest{,}
cd extension
# Minify JSON files.
json -j0 -I -e "$PACKAGE_JSON_CLEANUP_JS" -f package.json
sed -i '' -e '2d' package.json
perl -pi -e 'chomp if eof' package.json
json5 -o language-configuration.json{,}
# Remove comments from Markdown files.
sed -i '' -e '1,8d' README.md CHANGELOG.md
tail -n +9 README.md > _ && mv _ README.md
tail -n +9 CHANGELOG.md > _ && mv _ CHANGELOG.md
cd ext
# Minify Perl scripts.
if [ -x "$(command -v perltidy)" ]; then

Loading…
Cancel
Save