将在Windows计算机上本地编译的css文件推送到共享主机的方法

时间:2021-03-22 07:38:26

I'm in a situation that I'm to use my local machine (Win7) to do some LESS styles and then compile it into a single style.css file.

我遇到的情况是我要用我的本地机器(Win7)做一些LESS样式,然后将它编译成一个style.css文件。

What I want to know is what's the best method on pushing the style.css itself to a wordpress blog I host on a shared hosting service without the hassle of manually uploading the style.css every time I compile it. It would be most convenient if there's a method to "sync" the file to the shared hosting automatically.

我想知道的是将style.css本身推送到我在共享主机服务上托管的wordpress博客的最佳方法是什么,而不必在每次编译时手动上传style.css。如果有一种方法可以自动将文件“同步”到共享主机,那将是最方便的。

I don't mind installing another Win7 application if needed, as long as I can achieve the auto-sync method.

我不介意在需要时安装另一个Win7应用程序,只要我能实现自动同步方法。

1 个解决方案

#1


2  

I would use cURL in a batch file that you just run and it FTP's the file. Not sure how you're compiling the CSS currently but you should be able to add it to the end of that process.

我会在你刚刚运行的批处理文件中使用cURL,而FTP则是文件。不知道你当前是如何编译CSS的,但你应该能够将它添加到该过程的最后。

First answer I could find for cURL: How do I install/set up and use cURL on Windows?

我可以找到cURL的第一个答案:如何在Windows上安装/设置和使用cURL?

curl -T %filename% ftp://%ftphost%/%ftpdir%/ --user %ftpuser%:%ftppass%

#1


2  

I would use cURL in a batch file that you just run and it FTP's the file. Not sure how you're compiling the CSS currently but you should be able to add it to the end of that process.

我会在你刚刚运行的批处理文件中使用cURL,而FTP则是文件。不知道你当前是如何编译CSS的,但你应该能够将它添加到该过程的最后。

First answer I could find for cURL: How do I install/set up and use cURL on Windows?

我可以找到cURL的第一个答案:如何在Windows上安装/设置和使用cURL?

curl -T %filename% ftp://%ftphost%/%ftpdir%/ --user %ftpuser%:%ftppass%