Skip to content

Commit 3bd022d

Browse files
committed
add install script and bump version to 0.1.3
1 parent 11e7d7f commit 3bd022d

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "office365-service"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
description = "Add your description here"
55
readme = "README.md"
66
authors = [

scripts/install.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
PROJECT="office365-service"
2+
3+
echo "Instalando $PROJECT ..."
4+
5+
# criar repositório git
6+
mkdir -p /var/repo/$PROJECT.git
7+
cd /var/repo/$PROJECT.git || exit
8+
git init --bare
9+
cd hooks || exit
10+
cat > /var/repo/$PROJECT.git/hooks/post-receive <<EOF
11+
#!/bin/sh
12+
WORK_TREE=/var/opt/$PROJECT
13+
if [ -d \$WORK_TREE ]; then
14+
git --work-tree=\$WORK_TREE --git-dir=/var/repo/$PROJECT.git checkout -f
15+
else
16+
git clone /var/repo/$PROJECT.git \$WORK_TREE
17+
fi
18+
EOF
19+
chmod +x post-receive
20+
21+
if [ ! -e "$HOME"/.local/bin/uv ]; then
22+
echo "instalando uv ..."
23+
curl -LsSf https://astral.sh/uv/install.sh | sh
24+
# Check if $HOME/.local/bin is already in PATH
25+
if ! echo "$PATH" | grep -q "$HOME/.local/bin"; then
26+
echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc
27+
fi
28+
fi
29+
30+
echo "instalando dependencias ..."
31+
npm install -g pm2

src/office365_service/sharepoint_service.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ def mover_arquivo(self, arquivo_origem: File, pasta_destino: Folder | str):
200200
raise FileNotFoundError(f"A pasta de destino '{pasta_destino}' não foi encontrada.")
201201
pasta_destino = pasta
202202

203-
url_destino = os.path.join(pasta_destino.properties['ServerRelativeUrl'], arquivo_origem.name)
203+
print(f"Movendo '{arquivo_origem.name}' para '{pasta_destino.name}'...")
204+
205+
novo_arquivo = arquivo_origem.moveto(pasta_destino, flag=1)
206+
novo_arquivo.execute_query()
207+
208+
return novo_arquivo
204209

205-
print(f"Movendo '{arquivo_origem.name}' para '{pasta_destino.properties['ServerRelativeUrl']}'...")
206-
arquivo_origem.copyto(url_destino, True).execute_query()
207-
arquivo_origem.delete_object().execute_query()
208-
print("Arquivo movido com sucesso.")
209-
return self.ctx.web.get_file_by_server_relative_url(url_destino)
210210

211211
@handle_sharepoint_errors()
212212
def copiar_arquivo(self, arquivo_origem: File, pasta_destino: Folder | str):

0 commit comments

Comments
 (0)