如何在Linux/macOS上将Sass与NetBeans结合使用

编程入门 行业动态 更新时间:2024-10-26 22:28:18
本文介绍了如何在Linux/macOS上将Sass与NetBeans结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我曾经能够按照NetBeans 8安装和使用Sass,如如何在Netbeans 8.0.1中使用SASS

I used to be able to install and use Sass with NetBeans 8 as described in the top answer on How to use SASS with Netbeans 8.0.1

现在,对于当前版本的Sass(1.14.1),安装有所不同.基本上只是下载并解压缩.这样就完成了,我已经将NetBeans指向了正确的位置.但是,当前的Sass版本无法从NetBeans中正确运行:

Now, with the current version of Sass (1.14.1), installing is different. Basically just download and untar. That's done and I've pointed NetBeans to the correct location. But this current version of Sass won't run correctly from NetBeans:

"/opt/dart-sass/sass" "--cache-location" "/home/jasper/.cache/netbeans/8.2/sass-compiler" "path_to_my.scss" "path_to_my.css" Could not find an option named "cache-location".

Netbeans 8.2中的ass输出错误也覆盖了此错误他们使用Windows的地方.

This error is also covered by Sass output error in Netbeans 8.2 where they are using Windows.

我试图将缓存位置参数(类似于Windows的解决方案)添加到sass文件中的此行:

I tried to add the cache location parameter (similar to the solution for Windows) to this line in the sass file:

exec "$path/src/dart" --no-preview-dart-2 "-Dversion=1.14.1" "$path/src/sass.dart.snapshot" "$@"

但我无法使其正常运行(相同的错误不断出现).

but I could not get it working (same error keeps appearing).

关于在Linux(Ubuntu)上如何从NetBeans 8.2中获取Sass 1.14.1的任何想法?

Anybody any ideas on how to get Sass 1.14.1 working from NetBeans 8.2 on Linux (Ubuntu)?

推荐答案

问题是--cache-location不再受支持,应将其删除. "$@"使用所有原始参数.要删除前两个参数,您应该可以使用"${@:3}"(请参阅处理除第一个参数外的所有参数(在bash脚本中)),但不知何故,这对我造成了替换错误"错误.所以我选择使用shift 2删除它们:

The issue is that --cache-location is no longer supported and should be removed. All of the original parameters are used by "$@". To remove the first two parameters, you should be able to use "${@:3}" (see Process all arguments except the first one (in a bash script)), but somehow that resulted into a "Bad substitution" error for me. So I opted to use shift 2 to remove them:

#!/bin/sh # Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style # license that can be found in the LICENSE file or at # opensource/licenses/MIT. # This script drives the standalone Sass package, which bundles together a Dart # executable and a snapshot of Sass. It can be created with `pub run grinder # package`. follow_links() { file="$1" while [ -h "$file" ]; do # On Mac OS, readlink -f doesn't work. file="$(readlink "$file")" done echo "$file" } # Unlike $0, $BASH_SOURCE points to the absolute path of this file. path=`dirname "$(follow_links "$0")"` shift 2 exec "$path/src/dart" --no-preview-dart-2 "-Dversion=1.14.1" "$path/src/sass.dart.snapshot" "${@}"

确保保留原始文件并创建一个仅用于NetBeans的副本,然后在其中进行更改.

Make sure to keep the original file and create a copy to only be used with NetBeans and make the change there.

如果要查找Dart Sass的安装位置(使用Home Brew安装后),则位于此处:

If you are looking for the Dart Sass install location (after installing it with Home Brew), it is located here:

/usr/local/Cellar/sass/{version}/bin

NetBeans 11

在NetBeans 11上,我必须使用shift 3而不是shift 2.

更多推荐

如何在Linux/macOS上将Sass与NetBeans结合使用

本文发布于:2023-10-26 11:04:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529948.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上将   如何在   Linux   macOS   Sass

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!